CI #426
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |