2021-02-11 20:55:45 +01:00
|
|
|
name: Build
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-11-17 06:56:28 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-01-02 01:41:35 +01:00
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-11
|
2021-11-17 06:56:28 +01:00
|
|
|
nix:
|
2022-04-26 02:56:50 +02:00
|
|
|
- name: 2.8.0
|
|
|
|
url: https://releases.nixos.org/nix/nix-2.8.0/install
|
2022-01-02 01:41:35 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-02-11 20:55:45 +01:00
|
|
|
steps:
|
2021-10-28 23:09:35 +02:00
|
|
|
- uses: actions/checkout@v2.3.5
|
2022-04-26 02:57:25 +02:00
|
|
|
- uses: cachix/install-nix-action@v17
|
2021-06-29 10:02:43 +02:00
|
|
|
with:
|
2021-11-17 06:56:28 +01:00
|
|
|
install_url: ${{ matrix.nix.url }}
|
2021-06-29 10:02:43 +02:00
|
|
|
extra_nix_config: |
|
|
|
|
experimental-features = nix-command flakes
|
2021-11-22 20:20:41 +01:00
|
|
|
|
|
|
|
- name: Enable Binary Cache
|
|
|
|
uses: cachix/cachix-action@v10
|
2021-11-18 07:21:00 +01:00
|
|
|
with:
|
|
|
|
name: colmena
|
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
2021-06-29 10:02:43 +02:00
|
|
|
|
2021-09-20 07:03:39 +02:00
|
|
|
- run: nix flake check
|
2022-04-28 00:05:01 +02:00
|
|
|
if: ${{ !contains(matrix.nix.name, '2.3') && runner.os != 'macOS' }}
|
2021-11-18 07:21:00 +01:00
|
|
|
|
2021-11-17 06:56:28 +01:00
|
|
|
- name: Build Colmena
|
|
|
|
run: nix build -L
|
|
|
|
if: ${{ !contains(matrix.nix.name, '2.3') }}
|
2021-11-18 07:21:00 +01:00
|
|
|
|
2021-12-07 00:08:09 +01:00
|
|
|
- name: Build and install Colmena with flake-compat
|
|
|
|
run: nix-env -if default.nix
|
2021-09-20 07:03:39 +02:00
|
|
|
|
2021-11-18 07:21:00 +01:00
|
|
|
- name: Build manual
|
|
|
|
run: nix build .#manual -L
|
2022-07-02 02:41:05 +02:00
|
|
|
if: ${{ !contains(matrix.nix.name, '2.3') && runner.os != 'macOS' }}
|
2021-11-18 07:21:00 +01:00
|
|
|
|
2021-02-11 20:55:45 +01:00
|
|
|
tests:
|
2021-11-17 06:56:28 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-01-02 01:41:35 +01:00
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
2021-11-17 06:56:28 +01:00
|
|
|
nix:
|
|
|
|
- name: 2.3.16
|
|
|
|
url: https://releases.nixos.org/nix/nix-2.3.16/install
|
|
|
|
- name: 2.4
|
|
|
|
url: https://releases.nixos.org/nix/nix-2.4/install
|
2022-04-26 02:56:50 +02:00
|
|
|
- name: 2.8.0
|
|
|
|
url: https://releases.nixos.org/nix/nix-2.8.0/install
|
2022-01-02 01:41:35 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-02-11 20:55:45 +01:00
|
|
|
steps:
|
2021-10-28 23:09:35 +02:00
|
|
|
- uses: actions/checkout@v2.3.5
|
2022-04-26 02:57:25 +02:00
|
|
|
- uses: cachix/install-nix-action@v17
|
2021-09-20 07:03:39 +02:00
|
|
|
with:
|
2021-11-17 06:56:28 +01:00
|
|
|
install_url: ${{ matrix.nix.url }}
|
2021-09-20 07:03:39 +02:00
|
|
|
extra_nix_config: |
|
|
|
|
experimental-features = nix-command flakes
|
2021-11-18 07:21:00 +01:00
|
|
|
- uses: cachix/cachix-action@v10
|
|
|
|
with:
|
|
|
|
name: colmena
|
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
2021-09-20 07:03:39 +02:00
|
|
|
|
2022-01-02 01:41:35 +01:00
|
|
|
- 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
|
|
|
|
|
2021-06-29 10:15:36 +02:00
|
|
|
- run: nix-shell --run "cargo test"
|
2021-11-17 06:56:28 +01:00
|
|
|
if: ${{ !contains(matrix.nix.name, '2.3') }}
|
|
|
|
- run: nix-shell --run "cargo test -- --skip flake"
|
|
|
|
if: ${{ contains(matrix.nix.name, '2.3') }}
|