ci #29
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: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test: | |
name: Nim ${{ matrix.nim }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- platform: arm64 | |
nim: 2.2.0 | |
- platform: amd64 | |
nim: 2.0.8 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run Tests | |
run: | | |
docker pull --platform=${{ matrix.platform }} nimlang/nim:${{ matrix.nim }} | |
docker run --platform=${{ matrix.platform }} --rm -v `pwd`:/usr/src/app -w /usr/src/app nimlang/nim:${{ matrix.nim }} /bin/bash -c "git config --global --add safe.directory /usr/src/app; nimble install -y; nimble test" | |
docs: | |
name: Docs - Nim ${{ matrix.nim }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
# just keep last version | |
- platform: arm64 | |
nim: 2.2.0 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build docs | |
run: | | |
docker pull --platform=${{ matrix.platform }} nimlang/nim:${{ matrix.nim }} | |
docker run --platform=${{ matrix.platform }} --rm -v `pwd`:/usr/src/app -w /usr/src/app nimlang/nim:${{ matrix.nim }} /bin/bash -c "git config --global --add safe.directory /usr/src/app; nimble install -y; nimble docs" | |
- name: Deploy docs | |
# to view docs on your own fork: push a gh-pages branch on your fork, | |
# enable gh-pages in your fork | |
# and remove `github.ref == 'refs/heads/master'` below | |
if: | | |
github.event_name == 'push' && github.ref == 'refs/heads/master' | |
uses: crazy-max/ghaction-github-pages@v1 | |
with: | |
build_dir: docs | |
target_branch: gh-pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |