ci: add workflow for checking nix packages

This commit is contained in:
Krzysztof Saczuk 2024-04-15 00:36:14 +02:00
parent 14ae5129f6
commit 0159131956
No known key found for this signature in database

47
.github/workflows/nix.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: Check nix packages
on:
pull_request:
push:
branches: [master]
jobs:
flake:
name: Check flake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v5
with:
send-statistics: false
fail-mode: true
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- name: Check repository
run: nix flake check
matrix:
name: Generate build matrix
runs-on: ubuntu-latest
outputs:
themes: ${{ steps.generate-matrix.outputs.themes }}
steps:
- uses: actions/checkout@v4
- name: Generate matrix
id: generate-matrix
run: |
THEMES=$(ls assets/backgrounds/ | sed 's/\.png$//g' | jq --raw-input | jq --slurp -c)
echo "themes=$THEMES" >> $GITHUB_OUTPUT
build:
name: Check nix build for theme ${{ matrix.theme }}
runs-on: ubuntu-latest
needs:
- matrix
strategy:
matrix:
theme: ${{ fromJSON(needs.matrix.outputs.themes) }}
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- name: Build package
run: nix build .#${{ matrix.theme }}-grub-theme