Skip to content

Select nim version with nimble #131

Select nim version with nimble

Select nim version with nimble #131

Workflow file for this run

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.x","== 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@v4
- uses: nim-lang/setup-nimble-action@v1
with:
nimble-version: 0.16.4
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@v4
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