Select nim version with nimble #141
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - test-* | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| default: '"== 2.2"' | |
| concurrency: # Cancel stale PR builds (but not push builds) | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: ${{ fromJSON(format('[{0}]', inputs.branch || '"== 1.2.0","~= 1.2.x","== 1.4.2","~= 1.4.2","== 1.6.0","~= 1.6.0","== 2.0.0","~= 2.0.0","== 2.2.0","~= 2.2.0","#head"')) }} | |
| name: 'nim ${{matrix.branch}}' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - uses: nim-lang/setup-nimble-action@v1 | |
| with: | |
| nimble-version: "80c5afd39a279c619a9cd93890355acf06ef55a6" | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run tests | |
| run: | | |
| env TEST_LANG="c" nimble test --requires="nim ${{matrix.branch}}" | |
| env TEST_LANG="cpp" nimble test --requires="nim ${{matrix.branch}}" | |
| lint: | |
| name: "Check formatting" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Check `nph` formatting | |
| uses: arnetheduck/nph-action@v1 | |
| with: | |
| version: latest | |
| options: "." |