nim-task-runner/.github/workflows/test.yml

88 lines
2.2 KiB
YAML

name: Tests
on:
pull_request:
push:
branches:
- master
jobs:
tests:
env:
NPROC: 2
strategy:
fail-fast: false
matrix:
platform:
- {
icon: 🏁,
os: windows,
shell: msys2
}
- {
icon: 🍎,
os: macos,
shell: bash --noprofile --norc -eo pipefail
}
- {
icon: 🐧,
os: ubuntu,
shell: bash --noprofile --norc -eo pipefail
}
name: ${{ matrix.platform.icon }} ${{ matrix.platform.os }}
runs-on: ${{ matrix.platform.os }}-latest
defaults:
run:
shell: ${{ matrix.platform.shell }} {0}
steps:
- name: Install Valgrind via APT
if: matrix.platform.os == 'ubuntu'
run: |
sudo apt install -y valgrind
- name: Install awk (gawk) and coreutils via Homebrew
if: matrix.platform.os == 'macos'
run: |
brew install coreutils gawk
- uses: msys2/setup-msys2@v2
if: matrix.platform.os == 'windows'
with:
msystem: MINGW64
update: true
install: >
base-devel
git
mingw-w64-x86_64-toolchain
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Calculate cache key from submodules tree
id: calc-cache-key
run: |
echo "::set-output name=hash::$(git submodule foreach --quiet --recursive 'git rev-parse $(git rev-parse --abbrev-ref HEAD)' | sha1sum | awk '{print $1}')"
- uses: actions/cache@v2
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ matrix.platform.os }}-${{ steps.calc-cache-key.outputs.hash }}
- name: Install and build dependencies
run: |
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 update
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 deps
- name: Build and run tests
run: |
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 test
- name: Build and run helgrind tasks
if: matrix.platform.os == 'ubuntu'
run: |
./env.sh nimble achannels_helgrind