ci: add check and format workflows

This commit is contained in:
ooks-io 2025-01-19 00:16:13 +11:00
parent 6f3ab0b8d3
commit 082722b2a8
3 changed files with 94 additions and 21 deletions

View file

@ -1,30 +1,45 @@
name: Build Packages name: "Build packages and push to cache"
on: on:
push: push:
paths: paths:
- "outputs/pkgs/**" - outputs/pkgs/**
branches: branches:
- main - main
concurrency:
group: ooknet-cache-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
package:
- ook-vim
- live-buds-cli
- caddy-with-cloudflare
- fpp-config
- fpp-launcher
- fpp-sd
- project-plus
- repomix
- website
- wii-u-gc-adapter
- spotify-player
steps: steps:
- uses: actions/checkout@v4 - name: Checkout
- uses: cachix/install-nix-action@v25 uses: actions/checkout@v4
- uses: cachix/cachix-action@v14 - name: Setup Nix
with: uses: DeterminateSystems/nix-installer-action@main
name: ooknet - name: Magic Nix Cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build packages - name: Setup Cachix
run: | uses: cachix/cachix-action@v15
nix build \ with:
.#ook-vim \ name: ooknet
.#live-buds-cli \ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
.#caddy-with-cloudflare \ extraPullNames: nix-community
.#fpp-config \ - name: Check Flake
.#fpp-launcher \ run: nix flake check
.#fpp-sd \ - name: Build packages
.#project-plus \ run: nix build .#${{ matrix.package }} --print-build-logs
.#repomix \ continue-on-error: true
.#website \
.#wii-u-gc-adapter

24
.github/workflows/check.yaml vendored Normal file
View file

@ -0,0 +1,24 @@
name: "Nix Flake Check"
on:
push:
branches:
- main
paths-ignore:
- outputs/pkgs/**
- .github/**
concurrency:
group: ooknet-check-${{ github.ref }}
cancel-in-progress: true
jobs:
nix-flake-check:
name: Evaluate Flake
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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

34
.github/workflows/format.yaml vendored Normal file
View file

@ -0,0 +1,34 @@
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