-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,38 @@ | ||
name: Nix Flake Check | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
on: [push] | ||
|
||
jobs: | ||
checks: | ||
name: Check expressions | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cachix/install-nix-action@v18 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@v24 | ||
|
||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
- name: Install Nix Linting and Formatting Tools | ||
run: nix-env -i statix nixfmt -f '<nixpkgs>' | ||
|
||
- name: Run Statix Lint | ||
run: statix fix | ||
|
||
- name: Run Nix Format | ||
run: nix fmt | ||
|
||
- name: Nix Flake Checker | ||
uses: DeterminateSystems/flake-checker-action@v5 | ||
|
||
- name: Commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
install_url: https://nixos.org/nix/install | ||
extra_nix_config: | | ||
auto-optimise-store = true | ||
experimental-features = nix-command flakes | ||
access-tokens = ${{ secrets.AUTH_TOKEN }} | ||
- run: nix flake check | ||
commit_message: Auto lint/format | ||
branch: dev |