Skip to content

ci: drop the dead smoke step and stop runs from erasing or cancelling… #792

ci: drop the dead smoke step and stop runs from erasing or cancelling…

ci: drop the dead smoke step and stop runs from erasing or cancelling… #792

name: Quality & Testing
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_dispatch:
env:
NODE_VERSION: "22"
PNPM_VERSION: "10.26.2"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
auto-format:
name: Auto-fix Formatting
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Development Environment
uses: ./.github/actions/setup-env
with:
mode: node
- name: Auto-fix Prettier formatting
run: npx prettier --write . --ignore-unknown --cache
- name: Auto-fix Rust formatting
run: cargo fmt --all --manifest-path src-tauri/Cargo.toml
- name: Commit formatting fixes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
if ! git diff --staged --quiet; then
git commit -m "Auto-fix formatting issues"
git push
else
echo "No formatting changes to commit"
fi
rust-quality:
name: Rust Code Quality
runs-on: ubuntu-24.04
strategy:
fail-fast: false
defaults:
run:
shell: bash
working-directory: src-tauri
steps:
- uses: actions/checkout@v6
- name: Setup Rust Environment
uses: ./.github/actions/setup-env
with:
mode: build
rust-cache-save: false
- name: Install Rust components
shell: bash
run: rustup component add rustfmt clippy
- uses: rui314/setup-mold@v1
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Check Rust formatting
run: cargo fmt --all -- --color=always --check
- name: Run Clippy lints
run: cargo hack --feature-powerset --exclude-features cli-build --no-dev-deps clippy # cspell:disable-line
- name: Run Rust unit tests
run: cargo test --lib
# Fast lane: runs on every PR and push. Skips the heavy real Tauri build
# (kept under tests/index.js) but still covers Vitest + integration suites
# so feedback stays under ~5 minutes per OS instead of 20+.
validation-fast:
name: CLI Fast Validation (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, windows-latest, macos-latest]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Build Environment
uses: ./.github/actions/setup-env
with:
mode: build
rust-cache-save: false
- name: Build CLI
run: pnpm run cli:build
# dist/cli.js is a tracked build artifact; a bin/ change without the
# regenerated dist/cli.js ships stale CLI behavior. Linux only to avoid
# cross-OS line-ending noise.
- name: Verify committed dist/cli.js matches bin/ sources
if: runner.os == 'Linux'
shell: bash
run: |
if ! git diff --exit-code -- dist/; then
echo "::error::dist/cli.js is out of sync with bin/. Run 'pnpm run cli:build' and commit the regenerated dist/cli.js."
exit 1
fi
- name: Run Fast Test Suite
shell: bash
run: PAKE_CREATE_APP=1 node tests/index.js --no-build
timeout-minutes: 15
env:
CI: true
NODE_ENV: test
# Full lane: only runs after merge to main (push event) or manual dispatch.
# Keeps the real Tauri build coverage off the PR critical path.
validation-full:
name: Full Tauri Build (${{ matrix.os }})
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, windows-latest, macos-latest]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Build Environment
uses: ./.github/actions/setup-env
with:
mode: build
- name: Run Full Test Suite (with real build)
run: pnpm test
timeout-minutes: 30
env:
CI: true
NODE_ENV: test
docker-validation:
name: Docker Build and Packaging
timeout-minutes: 30
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: docker/setup-buildx-action@v3
- name: Build validation image
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: pake-validation:local
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Verify CLI and Linux installers
shell: bash
run: |
set -euo pipefail
docker run --rm pake-validation:local --version
mkdir -p "$RUNNER_TEMP/pake-docker-output"
docker run --rm --privileged --device /dev/fuse \
-v "$RUNNER_TEMP/pake-docker-output:/output" \
pake-validation:local https://example.com --name dockersmoke \
--icon /pake/src-tauri/icons/icon.png --targets deb,appimage --json
test -s "$RUNNER_TEMP/pake-docker-output/dockersmoke.deb"
test -s "$RUNNER_TEMP/pake-docker-output/dockersmoke.AppImage"
summary:
name: Quality Summary
runs-on: ubuntu-latest
needs: [auto-format, rust-quality, validation-fast, validation-full, docker-validation]
if: always()
steps:
- name: Generate Summary
run: |
{
echo "# Quality & Testing Summary"
echo ""
echo "| Check | Status |"
echo "|-------|--------|"
echo "| Auto Formatting | ${{ needs.auto-format.result == 'success' && 'PASSED' || needs.auto-format.result == 'skipped' && 'SKIPPED' || 'FAILED' }} |"
echo "| Rust Quality | ${{ needs.rust-quality.result == 'success' && 'PASSED' || 'FAILED' }} |"
echo "| CLI Fast Validation | ${{ needs.validation-fast.result == 'success' && 'PASSED' || 'FAILED' }} |"
echo "| Full Tauri Build | ${{ needs.validation-full.result == 'success' && 'PASSED' || needs.validation-full.result == 'skipped' && 'SKIPPED (PR fast lane)' || 'FAILED' }} |"
echo "| Docker Packaging | ${{ needs.docker-validation.result == 'success' && 'PASSED' || needs.docker-validation.result == 'skipped' && 'SKIPPED (PR fast lane)' || 'FAILED' }} |"
} >> $GITHUB_STEP_SUMMARY