mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-27 03:08:38 +02:00
feat: add github workflow - flake_check
This commit is contained in:
27
.github/workflows/flake_check.yml
vendored
Normal file
27
.github/workflows/flake_check.yml
vendored
Normal 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
|
||||||
Reference in New Issue
Block a user