feat: Migrate CI to gitea
This commit is contained in:
committed by
Hunter Halloran
parent
d205211c7d
commit
a23ec91c9c
90
.gitea/workflows/ci.yml
Normal file
90
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,90 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
flake-check:
|
||||
name: Flake Check
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check flake
|
||||
run: nix flake check --show-trace --print-build-logs
|
||||
|
||||
format-check:
|
||||
name: Format Check
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
nix fmt **/*.nix
|
||||
if ! git diff --quiet; then
|
||||
echo "::error::Code is not formatted. Please run 'nix fmt **/*.nix' locally."
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
|
||||
eval-configs:
|
||||
name: Evaluate Key Configurations
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
needs: [flake-check, format-check]
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- nix-builder
|
||||
- nix-laptop1
|
||||
- nix-desktop1
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Evaluate configuration
|
||||
run: |
|
||||
echo "Evaluating configuration for ${{ matrix.config }}"
|
||||
nix eval .#nixosConfigurations.${{ matrix.config }}.config.system.build.toplevel.drvPath \
|
||||
--show-trace
|
||||
|
||||
build-artifacts:
|
||||
name: Build Artifacts
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
needs: [flake-check, format-check]
|
||||
strategy:
|
||||
matrix:
|
||||
artifact:
|
||||
- lxc-nix-builder
|
||||
- installer-iso-nix-laptop1
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build artifact
|
||||
run: |
|
||||
echo "Building artifact ${{ matrix.artifact }}"
|
||||
nix build .#${{ matrix.artifact }} \
|
||||
--print-build-logs \
|
||||
--show-trace
|
||||
|
||||
- name: Show build result
|
||||
run: |
|
||||
if [ -L result ]; then
|
||||
ls -lh result/
|
||||
if [ -d result/iso ]; then
|
||||
ls -lh result/iso/
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user