ci: consolidate check and format

This commit is contained in:
ooks-io 2025-01-21 18:25:05 +11:00
parent 8a0a7d444c
commit e91fc01543
2 changed files with 24 additions and 49 deletions

View file

@ -10,24 +10,33 @@ concurrency:
group: ooknet-check-${{ github.ref }} group: ooknet-check-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
nix-flake-check: check-format:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- run: nix run nixpkgs#alejandra -- --check .
check-dead-code:
name: Check Dead Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/cachix-action@v15
with:
name: deadnix
- uses: astro/deadnix-action@main
check-flake:
name: Check Flake name: Check Flake
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0
# Get access to kunzen
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.0
with: with:
ssh-private-key: ${{ secrets.KUNZEN_DEPLOY_KEY }} ssh-private-key: ${{ secrets.KUNZEN_DEPLOY_KEY }}
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix flake check
- name: Setup Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Nix Flake
run: nix flake check

View file

@ -1,34 +0,0 @@
name: "Format Flake"
on:
push:
branches:
- main
paths-ignore:
- .github/**
- .gitignore
jobs:
alejandra:
name: Format with Alejandra
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Nix Magic Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Format Flake
run: nix run nixpkgs#alejandra -- -c .
deadnix:
name: Dead Code Analysis with Deadnix
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Deadnix
uses: cachix/cachix-action@v15
with:
name: deadnix
- uses: astro/deadnix-action@main