feat: add github workflow - flake_check

This commit is contained in:
Ryan Yin
2023-12-19 20:45:53 +08:00
parent 802e9e6e39
commit 2ac43c8a33

27
.github/workflows/flake_check.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Nix Flake Check
on: [push, pull_request, workflow_dispatch]
jobs:
checks:
name: Check expressions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v24
with:
install_url: https://nixos.org/nix/install
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes
- name: Run Nix Flake Check
run: |
output=$(nix flake check 2>&1)
echo "$output"
if echo "$output" | grep -q -i error; then
exit 1
fi