2020-04-08 16:39:06 +12:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2023-07-10 07:20:29 -05:00
|
|
|
merge_group:
|
2020-04-08 16:39:06 +12:00
|
|
|
|
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-10-02 02:00:47 +00:00
|
|
|
- uses: cachix/install-nix-action@v23
|
2023-02-02 15:53:51 +13:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2023-10-02 02:00:47 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-02 15:53:51 +13:00
|
|
|
- name: Check format
|
2023-10-24 17:22:01 -04:00
|
|
|
run: diff --unified overrides/build-systems.json <(jq --from-file overrides/sort-build-systems.jq --raw-output --sort-keys < overrides/build-systems.json)
|
2023-02-02 15:53:51 +13:00
|
|
|
|
2020-04-15 14:21:28 +01:00
|
|
|
nixpkgs-fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-02 02:00:47 +00:00
|
|
|
- uses: cachix/install-nix-action@v23
|
2021-08-11 18:11:38 -05:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2023-10-02 02:00:47 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-04-15 14:21:28 +01:00
|
|
|
- name: Check format
|
2023-10-24 17:21:01 -04:00
|
|
|
run: nix run 'nixpkgs#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-10-02 02:00:47 +00:00
|
|
|
- uses: cachix/install-nix-action@v23
|
2022-01-12 18:47:49 +13:00
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2023-10-02 02:00:47 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-12-18 16:19:01 -05:00
|
|
|
- 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
|
2023-10-24 17:21:01 -04:00
|
|
|
run: nix develop -c black --check .
|
2022-01-12 18:47:49 +13:00
|
|
|
|
2023-07-12 13:23:03 +12:00
|
|
|
nix-matrix:
|
2021-12-25 21:10:37 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
steps:
|
2023-10-02 02:00:47 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: cachix/install-nix-action@v23
|
2021-12-25 21:10:37 -08:00
|
|
|
- id: set-matrix
|
2023-07-12 13:23:03 +12:00
|
|
|
name: Generate Nix Matrix
|
2021-12-30 07:23:53 -05:00
|
|
|
run: |
|
2023-07-12 13:23:03 +12:00
|
|
|
set -Eeu
|
2023-07-14 17:36:10 +12:00
|
|
|
echo "matrix=$(nix eval --json '.#githubActions.matrix')" >> "$GITHUB_OUTPUT"
|
2021-12-25 21:10:37 -08:00
|
|
|
|
2023-07-12 13:23:03 +12:00
|
|
|
nix-build:
|
|
|
|
needs: nix-matrix
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-04-08 16:39:06 +12:00
|
|
|
strategy:
|
2023-07-12 13:23:03 +12:00
|
|
|
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
|
2020-04-08 16:39:06 +12:00
|
|
|
steps:
|
2023-10-02 02:00:47 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: cachix/install-nix-action@v23
|
2022-12-18 16:00:45 -05:00
|
|
|
- uses: cachix/cachix-action@v12
|
|
|
|
with:
|
|
|
|
name: poetry2nix
|
|
|
|
signingKey: "VhaWuN3IyJVpWg+aZvTocVB+W8ziZKKRGLKR53Pkld3YRZxYOUfXZf0fvqF+LkqVW0eA60trVd5vsqNONpX9Hw=="
|
2023-07-14 17:36:10 +12:00
|
|
|
- run: nix build -L ".#${{ matrix.attr }}"
|
2023-07-10 07:16:06 -05:00
|
|
|
|
|
|
|
collect:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- nixpkgs-fmt
|
|
|
|
- black-fmt
|
2023-07-12 13:23:03 +12:00
|
|
|
- nix-build
|
2023-07-10 07:16:06 -05:00
|
|
|
- sort-build-systems
|
|
|
|
steps:
|
2023-07-12 13:23:03 +12:00
|
|
|
- run: true
|