[CI] disable fail-fast and fix matrix.target -> matrix.os
#35
This file contains hidden or 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: impulse CI | |
| on: | |
| push: | |
| paths: | |
| - 'tests/**' | |
| - '**' | |
| - 'impulse.nimble' | |
| - '.github/workflows/ci.yml' | |
| pull_request: | |
| paths: | |
| - 'tests/**' | |
| - '**' | |
| - 'impulse.nimble' | |
| - '.github/workflows/ci.yml' | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| nim: | |
| - '1.6.x' | |
| - '2.0.x' | |
| - 'stable' | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macOS-latest | |
| name: '${{ matrix.nim }} (${{ matrix.os }})' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| path: impulse | |
| - name: Setup nim | |
| uses: jiro4989/setup-nim-action@v1 | |
| with: | |
| nim-version: ${{ matrix.nim }} | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup MSYS2 (Windows) | |
| if: ${{matrix.os == 'windows'}} | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| path-type: inherit | |
| update: true | |
| install: base-devel git mingw-w64-x86_64-toolchain | |
| - name: Install dependencies (Windows) | |
| if: ${{matrix.os == 'windows'}} | |
| shell: msys2 {0} | |
| run: | | |
| pacman -Syu --noconfirm | |
| pacman -S --needed --noconfirm mingw-w64-x86_64-lapack | |
| - name: Setup nimble & deps | |
| shell: bash | |
| run: | | |
| cd impulse | |
| nimble refresh -y | |
| nimble install -y | |
| - name: Run tests (Linux & OSX) | |
| if: ${{matrix.os != 'windows'}} | |
| shell: bash | |
| run: | | |
| cd impulse | |
| nimble -y test | |
| - name: Run tests (Windows) | |
| if: ${{matrix.os == 'windows'}} | |
| shell: msys2 {0} | |
| run: | | |
| cd impulse | |
| nimble -y test | |
| - name: Build docs | |
| if: > | |
| github.event_name == 'push' && github.ref == 'refs/heads/master' && | |
| matrix.os == 'linux' && matrix.branch == 'devel' | |
| shell: bash | |
| run: | | |
| cd impulse | |
| branch=${{ github.ref }} | |
| branch=${branch##*/} | |
| nimble doc --project --outdir:docs \ | |
| '--git.url:https://github.com/${{ github.repository }}' \ | |
| '--git.commit:${{ github.sha }}' \ | |
| "--git.devel:$branch" \ | |
| impulse.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 == 'linux' && matrix.branch == 'devel' | |
| uses: crazy-max/ghaction-github-pages@v1 | |
| with: | |
| build_dir: impulse/docs | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |