colmena/.github/workflows/tests.yml

43 lines
1.3 KiB
YAML
Raw Normal View History

2022-08-17 04:15:43 +02:00
name: Tests
on:
pull_request:
push:
jobs:
tests:
strategy:
matrix:
os:
- label: Linux
image: ubuntu-latest
nix:
- version: 2.3.16
url: https://releases.nixos.org/nix/nix-2.3.16/install
- version: 2.4
url: https://releases.nixos.org/nix/nix-2.4/install
- version: 2.10.3
url: https://releases.nixos.org/nix/nix-2.10.3/install
name: ${{ matrix.os.label }} + Nix ${{ matrix.nix.version }}
runs-on: ${{ matrix.os.image }}
steps:
- uses: actions/checkout@v3.3.0
with:
fetch-depth: 0
2022-08-17 04:15:43 +02:00
- name: Install Nix
uses: zhaofengli/nix-installer-action@zhaofeng
2022-08-17 04:15:43 +02:00
- name: Enable Binary Cache
uses: cachix/cachix-action@v12
2022-08-17 04:15:43 +02:00
with:
name: colmena
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Set up pinned nixpkgs
run: echo "NIX_PATH=nixpkgs=$(nix-instantiate --eval flake-compat.nix -A defaultNix.inputs.nixpkgs.outPath | sed 's|\"||g')" >> $GITHUB_ENV
- run: nix-shell --run "cargo test"
if: ${{ !contains(matrix.nix.version, '2.3') }}
- run: nix-shell --run "cargo test -- --skip flake"
if: ${{ contains(matrix.nix.version, '2.3') }}