Skip to content

CI

CI #443

Workflow file for this run

name: CI
on:
schedule:
- cron: '30 5 * * *'
push:
branches:
- master
paths:
- '**.cfg'
- '**.nims'
- '**.nim'
- '**.nimble'
- 'tests/**'
- '.github/workflows/ci.yml'
pull_request:
branches:
- '*'
paths:
- '**.cfg'
- '**.nims'
- '**.nim'
- '**.nimble'
- 'tests/**'
- '.github/workflows/ci.yml'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ['macos-latest', 'ubuntu-latest']
nim: ['devel', 'version-2-0']
name: '${{ matrix.os }} (${{ matrix.nim }})'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: project
- name: Setup Nim
uses: alaviss/setup-nim@0.1.1
with:
path: nim
version: ${{ matrix.nim }}
- name: Dependencies
shell: bash
run: |
cd project
nimble --accept develop
nimble --accept install "https://github.com/disruptek/balls"
- name: Tests
shell: bash
run: |
cd project
balls --path="."
- name: Build docs
if: ${{ matrix.docs }} == 'true'
shell: bash
run: |
cd project
branch=${{ github.ref }}
branch=${branch##*/}
nimble doc --project --path="." --outdir:docs \
'--git.url:https://github.com/${{ github.repository }}' \
'--git.commit:${{ github.sha }}' \
"--git.devel:$branch" \
badresults.nim
# Ignore failures for older Nim
cp docs/{the,}index.html || true
- name: Publish docs
if: >
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
matrix.os == 'ubuntu-latest' && matrix.nim == 'devel'
uses: crazy-max/ghaction-github-pages@v1
with:
build_dir: project/docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}