-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from ISibboI/56-add-nix-fmt-to-ci
Add nix fmt to CI and clean up flake
- Loading branch information
Showing
4 changed files
with
172 additions
and
122 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Nix Lints | ||
|
||
on: | ||
push: | ||
paths: | ||
# Run if workflow changes | ||
- '.github/workflows/nix-lints.yml' | ||
# Run on changed flake | ||
- 'flake.nix' | ||
- 'flake.lock' | ||
branches: | ||
- main | ||
pull_request: | ||
branches: main | ||
# Run manually | ||
workflow_dispatch: | ||
|
||
jobs: | ||
nix_fmt: | ||
name: Nix format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install nix | ||
uses: cachix/install-nix-action@v22 | ||
|
||
- name: Cache /nix/store | ||
uses: actions/cache@v3 | ||
with: | ||
path: /nix/store | ||
key: ${{ runner.os }}-${{ hashFiles('flake.*') }}-${{ hashFiles('.github/workflows/web-api-ci.yml') }} | ||
|
||
- name: Check nix formatting | ||
run: nix fmt --accept-flake-config -- --check . | ||
|
||
nix_dead_code: | ||
name: Nix dead code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install nix | ||
uses: cachix/install-nix-action@v22 | ||
|
||
- name: Cache /nix/store | ||
uses: actions/cache@v3 | ||
with: | ||
path: /nix/store | ||
key: ${{ runner.os }}-${{ hashFiles('flake.*') }}-${{ hashFiles('.github/workflows/web-api-ci.yml') }} | ||
|
||
- name: Check for dead nix code | ||
run: nix run github:astro/deadnix -- . |
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
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
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