ci: add check and lint workflows
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
name: Check
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.nix'
|
||||
- flake.lock
|
||||
- npins/sources.json
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
nix-flake:
|
||||
name: Nix flake
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Install QEMU
|
||||
run: |
|
||||
sudo apt update -y
|
||||
sudo apt install -y qemu-user-static
|
||||
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@v22
|
||||
with:
|
||||
extra-conf: |
|
||||
log-lines = 500
|
||||
extra-platforms = aarch64-linux
|
||||
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Check Nix flake outputs
|
||||
run: nix flake check --all-systems --show-trace
|
||||
@@ -0,0 +1,35 @@
|
||||
name: Lint
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.nix'
|
||||
- flake.lock
|
||||
- npins/sources.json
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
nix-expressions:
|
||||
name: Nix expressions
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@v22
|
||||
with:
|
||||
extra-conf: |
|
||||
log-lines = 500
|
||||
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Check if properly formatted
|
||||
run: nix fmt -- -c .
|
||||
|
||||
- name: Static code analysis
|
||||
if: always()
|
||||
run: nix run nixpkgs#statix -- check -i npins
|
||||
|
||||
- name: Scan for dead code
|
||||
if: always()
|
||||
run: nix run nixpkgs#deadnix -- -f --exclude npins
|
||||
Reference in New Issue
Block a user