poetry2nix/.github/workflows/ci.yml

82 lines
2.2 KiB
YAML
Raw Normal View History

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:
sort-build-systems:
runs-on: ubuntu-22.04
steps:
2023-10-02 02:00:47 +00:00
- uses: cachix/install-nix-action@v23
with:
nix_path: nixpkgs=channel:nixos-unstable
2023-10-02 02:00:47 +00:00
- uses: actions/checkout@v4
- 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)
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
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
- uses: cachix/cachix-action@v12
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
nix-matrix:
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
- id: set-matrix
name: Generate Nix Matrix
2021-12-30 07:23:53 -05:00
run: |
set -Eeu
echo "matrix=$(nix eval --json '.#githubActions.matrix')" >> "$GITHUB_OUTPUT"
nix-build:
needs: nix-matrix
runs-on: ${{ matrix.os }}
2020-04-08 16:39:06 +12:00
strategy:
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
- uses: cachix/cachix-action@v12
with:
name: poetry2nix
signingKey: "VhaWuN3IyJVpWg+aZvTocVB+W8ziZKKRGLKR53Pkld3YRZxYOUfXZf0fvqF+LkqVW0eA60trVd5vsqNONpX9Hw=="
- run: nix build -L ".#${{ matrix.attr }}"
collect:
runs-on: ubuntu-latest
needs:
- nixpkgs-fmt
- black-fmt
- nix-build
- sort-build-systems
steps:
- run: true