2020-07-12 17:33:08 +01:00
|
|
|
name: "Test"
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
- cron: '51 2 * * *'
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
nixPath:
|
2021-08-27 20:47:16 +02:00
|
|
|
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-21.05.tar.gz
|
2021-09-30 21:58:40 +02:00
|
|
|
- nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz
|
2020-07-22 15:57:46 +01:00
|
|
|
os: [ ubuntu-latest, macos-latest ]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-07-12 17:33:08 +01:00
|
|
|
steps:
|
2022-03-07 22:05:40 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-22 22:04:35 +00:00
|
|
|
- uses: cachix/install-nix-action@v16
|
2020-07-12 17:33:08 +01:00
|
|
|
with:
|
|
|
|
nix_path: "${{ matrix.nixPath }}"
|
|
|
|
- name: Setup cachix
|
2021-04-19 06:04:13 +00:00
|
|
|
uses: cachix/cachix-action@v10
|
2020-07-12 17:33:08 +01:00
|
|
|
with:
|
|
|
|
name: mic92
|
|
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
2020-07-12 22:10:56 +01:00
|
|
|
- name: Add keys group (needed for go tests)
|
|
|
|
run: sudo groupadd keys
|
2020-07-22 15:57:46 +01:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2021-02-01 13:23:17 +01:00
|
|
|
- name: Run lint
|
|
|
|
run: nix-build --no-out-link default.nix -A lint
|
2021-02-01 12:12:20 +01:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2021-11-16 09:03:10 +01:00
|
|
|
- name: List flake structure
|
|
|
|
run: nix flake show
|
|
|
|
- name: Run flake check (flake)
|
|
|
|
run: nix flake check -L
|
|
|
|
# this should be the same as `nix flake check`
|
2020-11-13 10:39:17 +01:00
|
|
|
- name: Build nix packages
|
|
|
|
run: nix-build --no-out-link release.nix
|
|
|
|
- name: Run unit tests
|
|
|
|
run: nix-shell --no-out-link ./unit-tests.nix --argstr sudo "$(command -v sudo)" --pure --run 'true'
|