refs #98
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
# yamllint disable rule:line-length | |
name: build | |
# yamllint disable rule:truthy | |
on: | |
pull_request: | |
paths-ignore: | |
- '*.md' | |
push: | |
paths-ignore: | |
- '*.md' | |
# yamllint enable rule:truthy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
test_x86: | |
name: Test nim-${{ matrix.nim-version }} / ${{ matrix.runs-on }} / x86_64 | |
runs-on: ${{ matrix.runs-on }} | |
timeout-minutes: ${{ matrix.timeout-minutes }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- runs-on: macos-latest | |
nim-version: 'ref:version-2-0' | |
sanitize-threads: 'yes' | |
timeout-minutes: 20 | |
- runs-on: ubuntu-latest | |
nim-version: 'latest:2.0' | |
sanitize-threads: 'yes' | |
timeout-minutes: 5 | |
steps: | |
# Optimization: re-use cached Nim->C compilation | |
- name: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: ${HOME}/.cache | |
key: cache-${{ matrix.runs-on }}-${{ matrix.nim-version }} | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Install Nim | |
uses: asdf-vm/actions/install@v3 | |
- name: Install dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update -q -y | |
sudo apt-get -qq install -y clang | |
- name: Run tests | |
run: | | |
export SANITIZE_THREADS | |
SANITIZE_THREADS=${{ matrix.sanitize-threads }} | |
. "${HOME}/.asdf/asdf.sh" | |
asdf local nim ${{ matrix.nim-version }} | |
nimble develop -y | |
nimble test | |
nimble examples | |
test_non_x86: | |
name: Test nim-${{ matrix.nim-version }} / debian-buster / ${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: aarch64 | |
nim-version: 'ref:version-2-0' | |
steps: | |
# Optimization: re-use cached Nim->C compilation | |
- name: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: ${HOME}/.cache | |
key: cache-${{ matrix.arch }}-${{ matrix.nim-version }} | |
- name: Checkout Nim project | |
uses: actions/checkout@v4 | |
# Install & run tests on non-x86 | |
- uses: uraimo/run-on-arch-action@v2.7.2 | |
name: Install Nim & run tests | |
with: | |
arch: ${{ matrix.arch }} | |
distro: buster | |
dockerRunArgs: | | |
--volume "${HOME}/.cache:/root/.cache" | |
setup: mkdir -p "${HOME}/.cache" | |
shell: /usr/bin/env bash | |
install: | | |
set -uexo pipefail | |
# Install asdf and dependencies | |
apt-get update -q -y | |
apt-get -qq install -y build-essential curl git | |
git clone https://github.com/asdf-vm/asdf.git \ | |
"${HOME}/.asdf" \ | |
--branch v0.10.2 | |
env: | | |
SANITIZE_THREADS: no | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -uexo pipefail | |
. "${HOME}/.asdf/asdf.sh" | |
# Install asdf-nim and dependencies | |
echo "::group::Install Nim" | |
git clone https://github.com/asdf-community/asdf-nim.git \ | |
~/asdf-nim \ | |
--branch main \ | |
--depth 1 | |
asdf plugin add nim ~/asdf-nim | |
asdf nim install-deps -y | |
# Install Nim | |
asdf install nim ${{ matrix.nim-version }} | |
asdf local nim ${{ matrix.nim-version }} | |
echo "::endgroup::" | |
# Run tests | |
echo "::group::Run tests" | |
git config --global --add safe.directory ${PWD} | |
nimble develop -y | |
nimble test | |
nimble examples | |
echo "::endgroup::" |