2023-02-25 15:09:59 +00:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
evaluate:
|
|
|
|
name: List packages
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Install Nix
|
2023-06-27 14:31:49 +00:00
|
|
|
uses: cachix/install-nix-action@v22
|
2023-02-25 15:09:59 +00:00
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: List packages
|
|
|
|
id: list-packages
|
|
|
|
run: |
|
2023-03-28 17:10:59 +00:00
|
|
|
nix flake show . --json | jq -rc 'to_entries | map(.key as $type | select($type == "checks" or $type == "packages") | .value | to_entries | map(.key as $arch | select($arch == "x86_64-linux" or $arch == "x86_64-darwin") | .value | to_entries | map({type: $type, arch: $arch, os: (if $arch == "x86_64-linux" then "ubuntu-latest" else "macos-latest" end), key: .key})) | flatten) | flatten | "packages=\(.)"' >> $GITHUB_OUTPUT
|
2023-02-25 15:09:59 +00:00
|
|
|
|
|
|
|
outputs:
|
|
|
|
packages: ${{ steps.list-packages.outputs.packages }}
|
|
|
|
|
|
|
|
build:
|
|
|
|
needs: evaluate
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
build: ${{ fromJSON(needs.evaluate.outputs.packages) }}
|
|
|
|
|
2023-03-28 17:10:59 +00:00
|
|
|
name: ${{ matrix.build.key }} on ${{ matrix.build.arch }}
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.build.os }}
|
2023-02-25 15:09:59 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Install Nix
|
2023-06-27 14:31:49 +00:00
|
|
|
uses: cachix/install-nix-action@v22
|
2023-02-25 15:09:59 +00:00
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Build ${{ matrix.build.key }}
|
2023-03-28 17:10:59 +00:00
|
|
|
run: nix -L build .#${{ matrix.build.type }}.${{ matrix.build.arch }}.${{ matrix.build.key }}
|