fix(tests): isolate HUD state file in TestIntegration subprocess tests #642
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: codingbuddy-canary | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - stag-** | |
| paths: | |
| - 'apps/mcp-server/**' | |
| - 'packages/rules/**' | |
| - 'packages/claude-code-plugin/**' | |
| - '.antigravity/**' | |
| - '.claude/**' | |
| - '.codex/**' | |
| - '.cursor/**' | |
| - 'scripts/**' | |
| - .github/workflows/canary.yml | |
| permissions: | |
| statuses: write | |
| contents: read | |
| jobs: | |
| plugin-hooks-tests: | |
| # Regression gate for #1490 — HUD installer must sync hooks/lib | |
| # alongside the script. This job runs the Python pytest suites for | |
| # the plugin hooks (no node/yarn build needed) so a broken installer | |
| # cannot ship to canary or release. | |
| if: github.repository == 'JeremyDev87/codingbuddy' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.11' | |
| - name: Install pytest | |
| run: python3 -m pip install --quiet pytest | |
| - name: Run plugin hook test suites (#1490 regression gate) | |
| working-directory: packages/claude-code-plugin | |
| run: | | |
| python3 -m pytest \ | |
| tests/test_atomic_sync_with_lib.py \ | |
| tests/test_session_start_hud.py \ | |
| tests/test_install_hook_with_lib.py \ | |
| tests/test_health_check.py \ | |
| -v --tb=short | |
| - name: HUD install simulation (#1490 end-to-end gate) | |
| run: bash packages/claude-code-plugin/scripts/verify-install-simulation.sh | |
| publish-canary: | |
| needs: plugin-hooks-tests | |
| if: github.repository == 'JeremyDev87/codingbuddy' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: '24' | |
| - name: Restore dependencies from cache | |
| id: cache | |
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build mcp-server | |
| run: yarn workspace codingbuddy build | |
| # Generate a single canary version to ensure both packages use the same version | |
| # This fixes the timestamp mismatch bug where rules and mcp-server had different versions | |
| - name: Generate canary version | |
| run: | | |
| TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
| COMMIT_SHA=${GITHUB_SHA::7} | |
| VERSION="0.0.0-canary.${TIMESTAMP}.g${COMMIT_SHA}" | |
| if [ -z "$VERSION" ]; then | |
| echo "::error::Failed to generate canary version" | |
| exit 1 | |
| fi | |
| echo "CANARY_VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "Generated canary version: $VERSION" | |
| - name: Publish rules canary | |
| working-directory: packages/rules | |
| run: | | |
| VERSION="${{ env.CANARY_VERSION }}" | |
| cat <<< "$( jq --arg v "$VERSION" '.version = $v' package.json )" > package.json | |
| yarn npm publish --tag canary | |
| env: | |
| YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish mcp-server canary | |
| working-directory: apps/mcp-server | |
| run: | | |
| VERSION="${{ env.CANARY_VERSION }}" | |
| # Update version and replace workspace dependency with canary version | |
| cat <<< "$( jq --arg v "$VERSION" '.version = $v | .dependencies["codingbuddy-rules"] = $v' package.json )" > package.json | |
| yarn npm publish --tag canary | |
| env: | |
| YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Output mcp-server canary version | |
| working-directory: apps/mcp-server | |
| run: | | |
| name=$(jq -r .name package.json) | |
| version=$(jq -r .version package.json) | |
| yarn dlx action-status@0.1.1 --context "Published $name" --state success --description $version --url "https://unpkg.com/$name@$version/" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build plugin | |
| run: yarn workspace codingbuddy-claude-plugin build | |
| - name: Publish plugin canary | |
| working-directory: packages/claude-code-plugin | |
| run: | | |
| VERSION="${{ env.CANARY_VERSION }}" | |
| cat <<< "$( jq --arg v "$VERSION" '.version = $v' package.json )" > package.json | |
| yarn npm publish --tag canary | |
| env: | |
| YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Output plugin canary version | |
| working-directory: packages/claude-code-plugin | |
| run: | | |
| name=$(jq -r .name package.json) | |
| version=$(jq -r .version package.json) | |
| yarn dlx action-status@0.1.1 --context "Published $name" --state success --description $version --url "https://unpkg.com/$name@$version/" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |