phase 5
This commit is contained in:
@@ -38,39 +38,43 @@ jobs:
|
||||
run: |
|
||||
nix build .#checks.x86_64-linux.${{ matrix.test }} --print-out-paths | attic push lan:webref --stdin
|
||||
|
||||
# Quick checks (linting & formatting)
|
||||
lint:
|
||||
name: Linting & Formatting
|
||||
# Backend linting (using Nix flake app)
|
||||
lint-backend:
|
||||
name: Backend Linting
|
||||
runs-on: nixos
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run backend linting
|
||||
run: nix run .#lint-backend
|
||||
|
||||
- name: Configure Attic cache
|
||||
run: attic login lan http://127.0.0.1:2343 ${{ secrets.ATTIC_TOKEN }}
|
||||
# Frontend linting (using Nix flake app)
|
||||
lint-frontend:
|
||||
name: Frontend Linting
|
||||
runs-on: nixos
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Backend - Ruff check
|
||||
run: nix develop --command bash -c "cd backend && ruff check app/"
|
||||
- name: Install dependencies
|
||||
run: nix develop --quiet --command bash -c "cd frontend && npm ci --prefer-offline"
|
||||
|
||||
- name: Backend - Ruff format check
|
||||
run: nix develop --command bash -c "cd backend && ruff format --check app/"
|
||||
- name: Run frontend linting
|
||||
run: nix run .#lint-frontend
|
||||
|
||||
# Nix flake check (needs Nix)
|
||||
nix-check:
|
||||
name: Nix Flake Check
|
||||
runs-on: nixos
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Frontend linting temporarily disabled (Phase 3 - minimal frontend code)
|
||||
# Will re-enable when more frontend code is written (Phase 6+)
|
||||
# - name: Frontend - Install deps
|
||||
# run: nix develop --command bash -c "cd frontend && npm install --ignore-scripts"
|
||||
#
|
||||
# - name: Frontend - ESLint
|
||||
# run: nix develop --command bash -c "cd frontend && npm run lint"
|
||||
#
|
||||
# - name: Frontend - Prettier check
|
||||
# run: nix develop --command bash -c "cd frontend && npx prettier --check ."
|
||||
#
|
||||
# - name: Frontend - Svelte check
|
||||
# run: nix develop --command bash -c "cd frontend && npm run check"
|
||||
|
||||
- name: Nix - Flake check
|
||||
- name: Flake check
|
||||
run: nix flake check --quiet --accept-flake-config
|
||||
|
||||
# Unit tests - DISABLED until tests are written (Phase 23)
|
||||
@@ -96,46 +100,51 @@ jobs:
|
||||
# "
|
||||
#
|
||||
# - name: Frontend - Install deps
|
||||
# run: nix develop --command bash -c "cd frontend && npm install --ignore-scripts"
|
||||
# run: |
|
||||
# nix develop --command bash -c "
|
||||
# cd frontend &&
|
||||
# npm ci --prefer-offline --no-audit
|
||||
# "
|
||||
#
|
||||
# - name: Frontend unit tests
|
||||
# run: nix develop --command bash -c "cd frontend && npm run test:coverage"
|
||||
|
||||
# Build packages
|
||||
build:
|
||||
name: Build Packages
|
||||
runs-on: nixos
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure Attic cache
|
||||
run: attic login lan http://127.0.0.1:2343 ${{ secrets.ATTIC_TOKEN }}
|
||||
|
||||
- name: Build backend package
|
||||
run: |
|
||||
echo "Building backend package..."
|
||||
nix build .#backend --quiet --accept-flake-config
|
||||
|
||||
- name: Push backend to Attic
|
||||
if: success()
|
||||
run: nix build .#backend --print-out-paths | attic push lan:webref --stdin
|
||||
|
||||
- name: Build frontend package
|
||||
run: |
|
||||
echo "Building frontend package..."
|
||||
nix build .#frontend --quiet --accept-flake-config
|
||||
|
||||
- name: Push frontend to Attic
|
||||
if: success()
|
||||
run: nix build .#frontend --print-out-paths | attic push lan:webref --stdin
|
||||
# Build packages - DISABLED until packages are properly configured
|
||||
# TODO: Enable when backend pyproject.toml is set up and frontend package is ready
|
||||
# build:
|
||||
# name: Build Packages
|
||||
# runs-on: nixos
|
||||
#
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v4
|
||||
#
|
||||
# - name: Configure Attic cache
|
||||
# run: attic login lan http://127.0.0.1:2343 ${{ secrets.ATTIC_TOKEN }}
|
||||
#
|
||||
# - name: Build backend package
|
||||
# run: |
|
||||
# echo "Building backend package..."
|
||||
# nix build .#backend --quiet --accept-flake-config
|
||||
#
|
||||
# - name: Push backend to Attic
|
||||
# if: success()
|
||||
# run: nix build .#backend --print-out-paths | attic push lan:webref --stdin
|
||||
#
|
||||
# - name: Build frontend package
|
||||
# run: |
|
||||
# echo "Building frontend package..."
|
||||
# nix build .#frontend --quiet --accept-flake-config
|
||||
#
|
||||
# - name: Push frontend to Attic
|
||||
# if: success()
|
||||
# run: nix build .#frontend --print-out-paths | attic push lan:webref --stdin
|
||||
|
||||
# Summary
|
||||
summary:
|
||||
name: CI Summary
|
||||
runs-on: nixos
|
||||
needs: [nixos-vm-tests, lint, unit-tests, build]
|
||||
needs: [nixos-vm-tests, lint-backend, lint-frontend, nix-check]
|
||||
if: always()
|
||||
|
||||
steps:
|
||||
@@ -144,16 +153,16 @@ jobs:
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "📊 CI Pipeline Results"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "NixOS VMs: ${{ needs.nixos-vm-tests.result }}"
|
||||
echo "Linting: ${{ needs.lint.result }}"
|
||||
echo "Unit Tests: ${{ needs.unit-tests.result }}"
|
||||
echo "Build: ${{ needs.build.result }}"
|
||||
echo "NixOS VMs: ${{ needs.nixos-vm-tests.result }}"
|
||||
echo "Backend Lint: ${{ needs.lint-backend.result }}"
|
||||
echo "Frontend Lint: ${{ needs.lint-frontend.result }}"
|
||||
echo "Nix Check: ${{ needs.nix-check.result }}"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
|
||||
if [[ "${{ needs.nixos-vm-tests.result }}" != "success" ]] || \
|
||||
[[ "${{ needs.lint.result }}" != "success" ]] || \
|
||||
[[ "${{ needs.unit-tests.result }}" != "success" ]] || \
|
||||
[[ "${{ needs.build.result }}" != "success" ]]; then
|
||||
[[ "${{ needs.lint-backend.result }}" != "success" ]] || \
|
||||
[[ "${{ needs.lint-frontend.result }}" != "success" ]] || \
|
||||
[[ "${{ needs.nix-check.result }}" != "success" ]]; then
|
||||
echo "❌ Pipeline Failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user