Trying 1.6 comp #19
This file contains 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: Unit tests | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
nim-version: ['1.6.18', '2.0.14', '2.2.0'] | |
arch: [x64, arm64] | |
exclude: | |
# GitHub doesn't provide Windows ARM runners yet | |
- os: windows-latest | |
arch: arm64 | |
fail-fast: false | |
runs-on: ${{ matrix.arch == 'arm64' && matrix.os == 'macos-latest' && 'macos-14' || matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
# Install Nim on ARM platforms that need manual installation | |
- name: Install Nim (Ubuntu ARM64) | |
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc git | |
git clone https://github.com/nim-lang/nim.git | |
cd nim | |
git checkout v${{ matrix.nim-version }} | |
sh build_all.sh | |
bin/nim c koch | |
./koch boot -d:release | |
./koch tools | |
echo "$PWD/bin" >> $GITHUB_PATH | |
- name: Install Nim (macOS ARM64) | |
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' | |
uses: jiro4989/setup-nim-action@v2.2.2 | |
with: | |
nim-version: ${{ matrix.nim-version }} | |
# Default x64 installation | |
- name: Install Nim (x64) | |
if: matrix.arch == 'x64' | |
uses: jiro4989/setup-nim-action@v2.2.2 | |
with: | |
nim-version: ${{ matrix.nim-version }} | |
- name: Install dependencies | |
run: | | |
nimble install -y | |
nimble refresh | |
- name: Run tests | |
run: nimble test -y | |
- name: Cache nimble packages | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.nimble | |
${{ github.workspace }}/nimcache | |
${{ env.APPDATA }}/nimble # Windows-specific | |
~/Library/Nimble # macOS-specific | |
key: ${{ runner.os }}-${{ matrix.arch }}-nim-${{ matrix.nim-version }}-v1 | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.arch }}-nim-${{ matrix.nim-version }}- | |
${{ runner.os }}-${{ matrix.arch }}-nim- |