diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index 3796c0b..655affd 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -1,4 +1,4 @@ -name: VM Acceptance Test +name: Acceptance Test on: workflow_dispatch: @@ -16,29 +16,28 @@ permissions: jobs: acceptance: - name: VM Acceptance + name: Acceptance runs-on: macos-15 - timeout-minutes: 30 + timeout-minutes: 45 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - name: Cache Tart images - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 - with: - path: ~/.tart - key: tart-sequoia-base-${{ hashFiles('scripts/vm-acceptance-test.sh') }} - restore-keys: tart-sequoia-base- - - - name: Install Tart + # Pre-create ~/.secrets so setup.sh skips the interactive credential wizard. + # CI only needs a non-empty ANTHROPIC_API_KEY to satisfy the guard condition. + - name: Pre-create ~/.secrets (CI stub) run: | - brew install cirruslabs/cli/tart - - - name: Install sshpass - run: brew install hudochenkov/sshpass/sshpass - - - name: Run VM acceptance test - run: bash scripts/vm-acceptance-test.sh - timeout-minutes: 25 + printf 'export ANTHROPIC_API_KEY="ci-dummy"\n' > "$HOME/.secrets" + chmod 600 "$HOME/.secrets" + + # Run setup.sh end-to-end on a fresh macOS runner, using the CI Brewfile + # to skip heavy GUI casks. This is functionally equivalent to a real machine + # install — the runner is a clean macOS environment on every job. + - name: Run setup.sh (CI Brewfile) + run: BREWFILE="$GITHUB_WORKSPACE/Brewfile.ci" bash setup.sh + timeout-minutes: 35 + + - name: Run acceptance tests + run: bash scripts/acceptance-test.sh - name: Upload logs on failure if: failure() diff --git a/scripts/acceptance-test.sh b/scripts/acceptance-test.sh index 798b7e8..6b593ac 100755 --- a/scripts/acceptance-test.sh +++ b/scripts/acceptance-test.sh @@ -1,9 +1,12 @@ #!/usr/bin/env bash -# Acceptance test suite. Runs INSIDE the Tart VM after setup.sh completes. +# Acceptance test suite. Run after setup.sh completes on any macOS machine. +# Works both locally and on GitHub-hosted macOS runners (no VM required). # Collects all failures before exiting — does not short-circuit on first error. set -euo pipefail +REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + # Ensure Homebrew tools are on PATH — this script runs via non-login bash # so .zprofile is never sourced. export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH" @@ -43,10 +46,8 @@ check "Homebrew prefix is writable" "test -w \"\$(brew --prefix)\"" section "Homebrew" check "brew is on PATH" "command -v brew" -check "cirruslabs/cli tap is active" "brew tap | grep -q cirruslabs/cli" -check "tart is installed" "command -v tart" check "no deprecated formulae in Brewfile" \ - "! brew bundle check --file=\"\$HOME/Repos/amcheste/mac-dev-setup/Brewfile\" 2>&1 | grep -qi deprecated" + "! brew bundle check --file=\"$REPO_DIR/Brewfile\" 2>&1 | grep -qi deprecated" # ── Dotfiles ───────────────────────────────────────────────────────────────────