Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into generic-lookup-work…
Browse files Browse the repository at this point in the history
…around
  • Loading branch information
arnetheduck committed Mar 11, 2024
2 parents 71e002b + 6340b04 commit 5d5dd59
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 63 deletions.
80 changes: 19 additions & 61 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: CI
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
branch:
default: '"stable"'

concurrency: # Cancel stale PR builds (but not push builds)
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
Expand All @@ -10,72 +18,22 @@ jobs:
strategy:
fail-fast: false
matrix:
target:
- os: linux
cpu: amd64
TEST_LANG: c
- os: linux
cpu: amd64
TEST_LANG: cpp
branch: [version-1-2, version-1-4, version-1-6, version-2-0, devel]
include:
- target:
os: linux
builder: ubuntu-20.04
shell: bash
defaults:
run:
shell: ${{ matrix.shell }}
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"')) }}

name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ matrix.target.TEST_LANG }} (Nim ${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
name: 'nim-${{matrix.branch}}'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Derive environment variables
shell: bash
run: |
if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then
ARCH=64
PLATFORM=x64
else
ARCH=32
PLATFORM=x86
fi
echo "ARCH=$ARCH" >> $GITHUB_ENV
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
if [[ '${{ matrix.target.os }}' == 'windows' ]]; then
MAKE_CMD="mingw32-make"
else
MAKE_CMD="make"
fi
echo "MAKE_CMD=$MAKE_CMD" >> $GITHUB_ENV
ncpu=
case '${{ runner.os }}' in
'Linux')
ncpu=$(nproc)
;;
'macOS')
ncpu=$(sysctl -n hw.ncpu)
;;
'Windows')
ncpu=$NUMBER_OF_PROCESSORS
;;
esac
[[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
echo "ncpu=$ncpu" >> $GITHUB_ENV
- name: Build the Nim compiler
run: |
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh
env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} CC=gcc NIM_COMMIT=${{ matrix.branch }} bash build_nim.sh nim csources dist/nimble NimBinaries
echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ matrix.branch }}
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: |
nim --version
env TEST_LANG="${{ matrix.target.TEST_LANG }}" nimble test
env TEST_LANG="c" nimble test
env TEST_LANG="cpp" nimble test
4 changes: 2 additions & 2 deletions tests/test_results.nim
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ block:
doAssert d.isErr

# De-reference
when (NimMajor, NimMinor) >= (1, 6):
when (NimMajor, NimMinor, NimPatch) >= (1, 6, 12):
{.warning[BareExcept]: off.}

try:
Expand All @@ -140,7 +140,7 @@ block:
except:
discard

when (NimMajor, NimMinor) >= (1, 6):
when (NimMajor, NimMinor, NimPatch) >= (1, 6, 12):
{.warning[BareExcept]: on.}

# Comparisons
Expand Down

0 comments on commit 5d5dd59

Please sign in to comment.