Files
athenix/.gitea/workflows/ci.yml

118 lines
3.0 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request_review:
workflow_dispatch:
permissions:
contents: read
jobs:
flake-check:
name: Flake Check
runs-on: [self-hosted, nix-builder]
needs: [format-check]
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
eval-artifacts:
name: Evaluate 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: Evaluate artifact
run: |
echo "Evaluating artifact ${{ matrix.artifact }}"
nix eval .#${{ matrix.artifact }}.drvPath \
--show-trace
build-docs:
name: Build and Publish Documentation
runs-on: [self-hosted, nix-builder]
needs: [flake-check]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build documentation
run: |
echo "Building Athenix documentation"
nix build .#docs --print-build-logs
- name: Clone wiki repository
run: |
git clone https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.wiki.git wiki
cd wiki
git config user.name "Athenix CI"
git config user.email "ci@athenix.factory.uga.edu"
- name: Update wiki with documentation
run: |
# Copy documentation to wiki
cp -r result/* wiki/
# Commit and push changes
cd wiki
git add .
if git diff --staged --quiet; then
echo "No documentation changes to commit"
else
git commit -m "Update documentation from commit ${{ github.sha }}"
git push
fi