2020-04-08 16:39:06 +12:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
2022-12-18 11:37:07 -05:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-04-08 16:39:06 +12:00
|
|
|
jobs:
|
2023-02-02 15:53:51 +13:00
|
|
|
sort-build-systems:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
2023-03-01 17:49:06 +01:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2023-02-02 15:53:51 +13:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Check format
|
|
|
|
run: nix-shell --packages jq --pure --run 'diff overrides/build-systems.json <(jq --raw-output --sort-keys < overrides/build-systems.json)'
|
|
|
|
|
2020-04-15 14:21:28 +01:00
|
|
|
nixpkgs-fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-03-01 17:49:06 +01:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2021-08-11 18:11:38 -05:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2022-12-18 16:19:01 -05:00
|
|
|
- uses: actions/checkout@v3
|
2020-04-15 14:21:28 +01:00
|
|
|
- name: Check format
|
2022-05-10 07:52:57 +12:00
|
|
|
run: nix-shell --arg packages 'pkgs:[ pkgs.nixpkgs-fmt ]' --run 'nixpkgs-fmt --check .'
|
2020-04-15 14:21:28 +01:00
|
|
|
|
2022-01-12 18:47:49 +13:00
|
|
|
black-fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-03-01 17:49:06 +01:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2022-01-12 18:47:49 +13:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2022-12-18 16:19:01 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: cachix/cachix-action@v12
|
2022-05-10 08:21:29 +12:00
|
|
|
with:
|
|
|
|
name: poetry2nix
|
|
|
|
signingKey: "VhaWuN3IyJVpWg+aZvTocVB+W8ziZKKRGLKR53Pkld3YRZxYOUfXZf0fvqF+LkqVW0eA60trVd5vsqNONpX9Hw=="
|
2022-01-12 18:47:49 +13:00
|
|
|
- name: Check format
|
2022-05-10 07:52:57 +12:00
|
|
|
run: nix-shell --arg packages 'pkgs:[ pkgs.p2nix-tools.env ]' --run 'black --check .'
|
2022-01-12 18:47:49 +13:00
|
|
|
|
2021-12-25 21:10:37 -08:00
|
|
|
matrix_generate:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
steps:
|
2022-12-18 16:19:01 -05:00
|
|
|
- uses: actions/checkout@v3
|
2023-03-01 17:49:06 +01:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2021-12-25 21:10:37 -08:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- id: set-matrix
|
2021-12-30 07:23:53 -05:00
|
|
|
run: |
|
|
|
|
set -euo pipefail
|
|
|
|
|
2022-12-18 16:00:45 -05:00
|
|
|
matrix="$(nix-instantiate --eval --json --expr 'builtins.attrNames (import ./tests {})' | jq -rcM '{attr: .}')"
|
2023-03-06 10:54:37 +13:00
|
|
|
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
2021-12-25 21:10:37 -08:00
|
|
|
|
2022-12-18 16:00:45 -05:00
|
|
|
builds-linux:
|
2021-12-25 21:10:37 -08:00
|
|
|
needs: matrix_generate
|
2022-12-18 16:00:45 -05:00
|
|
|
runs-on: ubuntu-latest
|
2020-04-08 16:39:06 +12:00
|
|
|
strategy:
|
2021-12-25 21:10:37 -08:00
|
|
|
matrix: ${{fromJSON(needs.matrix_generate.outputs.matrix)}}
|
2020-04-08 16:39:06 +12:00
|
|
|
steps:
|
2022-12-18 16:19:01 -05:00
|
|
|
- uses: actions/checkout@v3
|
2023-03-01 17:49:06 +01:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2021-12-25 21:10:37 -08:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2022-12-18 16:19:01 -05:00
|
|
|
- uses: cachix/cachix-action@v12
|
2021-12-25 21:10:37 -08:00
|
|
|
with:
|
|
|
|
name: poetry2nix
|
2022-05-10 08:21:29 +12:00
|
|
|
signingKey: "VhaWuN3IyJVpWg+aZvTocVB+W8ziZKKRGLKR53Pkld3YRZxYOUfXZf0fvqF+LkqVW0eA60trVd5vsqNONpX9Hw=="
|
2022-05-10 07:52:57 +12:00
|
|
|
- run: nix-shell --arg packages 'pkgs:[ pkgs.nix-build-uncached ]' --run 'nix-build-uncached -build-flags "-L" --keep-going --show-trace tests/default.nix -A ${{ matrix.attr }}'
|
2022-12-18 16:00:45 -05:00
|
|
|
|
|
|
|
builds-macos:
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-03-01 17:49:06 +01:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2022-12-18 16:00:45 -05:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- uses: cachix/cachix-action@v12
|
|
|
|
with:
|
|
|
|
name: poetry2nix
|
|
|
|
signingKey: "VhaWuN3IyJVpWg+aZvTocVB+W8ziZKKRGLKR53Pkld3YRZxYOUfXZf0fvqF+LkqVW0eA60trVd5vsqNONpX9Hw=="
|
|
|
|
- run: nix-shell --arg packages 'pkgs:[ pkgs.nix-build-uncached ]' --run 'nix-build-uncached -build-flags "-L" --keep-going --show-trace tests/default.nix'
|