Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 13 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:
inputs:
branch:
default: '"stable"'
default: '"== 2.2"'

concurrency: # Cancel stale PR builds (but not push builds)
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
Expand All @@ -19,41 +19,33 @@ jobs:
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(format('[{0}]', inputs.branch || '"1.2.0","1.2.x","1.4.2","1.4.x","1.6.0","1.6.x","2.0.0","2.0.x","stable","devel"')) }}
branch: ${{ fromJSON(format('[{0}]', inputs.branch || '" == 1.2.0"," ~= 1.2.0"," == 1.4.2"," ~= 1.4.2"," == 1.6.0"," ~= 1.6.0"," == 2.0.0"," ~= 2.0.0"," == 2.2.0"," ~= 2.2.0","#devel"')) }}

name: 'nim-${{matrix.branch}}'
name: 'nim ${{matrix.branch}}'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- uses: jiro4989/setup-nim-action@v1
- uses: nim-lang/setup-nimble-action@v1
with:
nim-version: ${{ matrix.branch }}
nimble-version: "nightly"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: |
nim --version
env TEST_LANG="c" nimble test
env TEST_LANG="cpp" nimble test
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@v4
uses: actions/checkout@v6
- name: Check `nph` formatting
uses: arnetheduck/nph-action@v1
with:
fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base

- name: Check nph formatting
# Pin nph to a specific version to avoid sudden style differences.
run: |
VERSION="v0.6.0"
ARCHIVE="nph-linux_x64.tar.gz"
curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE}
tar -xzf ${ARCHIVE}
./nph .
git diff --exit-code
version: latest
options: "."
2 changes: 1 addition & 1 deletion results.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ task test, "Runs the test suite":
for opt in ["-d:resultsGenericsOpenSym:false", "-d:resultsGenericsOpenSym:true"]:
test opt, "tests/" & f
if (NimMajor, NimMinor) >= (2, 0):
test opt & " --mm:refc", "tests/" & f
test opt & " --gc:refc", "tests/" & f

task bench, "Run benchmark":
test "-d:release", "benchmarks/benchmark.nim"
2 changes: 1 addition & 1 deletion tests/test_results.nim
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ block:
try:
echo rErr[]
doAssert false
except:
except Exception:
discard

when (NimMajor, NimMinor, NimPatch) >= (1, 6, 12):
Expand Down