fix: update publish-release.yml for mutable dependency installation a… #256
Workflow file for this run
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: CI | |
| on: push | |
| permissions: | |
| actions: read | |
| contents: read | |
| concurrency: | |
| group: enclave-ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| env: | |
| NX_DAEMON: "false" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node + Yarn | |
| uses: ./.github/actions/setup-node-yarn | |
| with: | |
| node-version-file: ".nvmrc" | |
| - name: Set Nx SHAs | |
| uses: nrwl/nx-set-shas@v4 | |
| - name: Run linter | |
| run: npx nx affected -t lint | |
| continue-on-error: true | |
| - name: Run prettier | |
| run: npx prettier --check . | |
| continue-on-error: true | |
| - name: Build libraries | |
| id: build | |
| run: npx nx affected -t build | |
| continue-on-error: true | |
| - name: Retry build with cache reset | |
| if: steps.build.outcome == 'failure' | |
| run: | | |
| echo "Build failed, resetting NX cache and retrying..." | |
| npx nx reset | |
| npx nx affected -t build --skip-nx-cache | |
| - name: Cache build artifacts | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| node_modules | |
| libs/*/dist | |
| key: build-${{ github.sha }} | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| needs: build | |
| env: | |
| NX_DAEMON: "false" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node + Yarn | |
| uses: ./.github/actions/setup-node-yarn | |
| with: | |
| node-version-file: ".nvmrc" | |
| # node_modules is restored from the build job's cache below; the | |
| # install after the restore reconciles it immutably. | |
| install: "false" | |
| - name: Restore build artifacts | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| node_modules | |
| libs/*/dist | |
| key: build-${{ github.sha }} | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Set Nx SHAs | |
| uses: nrwl/nx-set-shas@v4 | |
| - name: Test libraries | |
| id: test | |
| run: npx nx affected -t test --passWithNoTests 2>&1 | tee test-output.txt | |
| continue-on-error: true | |
| - name: Log failed tests to summary | |
| if: steps.test.outcome == 'failure' | |
| run: | | |
| echo "## ❌ Test Failures" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| # Extract failed test names and error messages | |
| grep -A 5 "FAIL\|✕\|Error:" test-output.txt | head -100 >> $GITHUB_STEP_SUMMARY || echo "Could not extract failure details" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| - name: Fail if tests failed | |
| if: steps.test.outcome == 'failure' | |
| run: exit 1 | |
| performance: | |
| name: Performance | |
| runs-on: ubuntu-latest | |
| needs: build | |
| env: | |
| NX_DAEMON: "false" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node + Yarn | |
| uses: ./.github/actions/setup-node-yarn | |
| with: | |
| node-version-file: ".nvmrc" | |
| - name: Restore build artifacts | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| node_modules | |
| libs/*/dist | |
| key: build-${{ github.sha }} | |
| - name: Run performance tests | |
| run: npx nx run core:test-perf --passWithNoTests | |
| continue-on-error: true | |
| - name: Generate performance summary | |
| if: always() | |
| run: | | |
| if [ -f "perf-results.json" ]; then | |
| echo "## Performance Test Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| node scripts/format-perf-summary.mjs perf-results.json >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "## Performance Tests" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "No performance results found. Tests may have been skipped or failed to run." >> $GITHUB_STEP_SUMMARY | |
| fi | |
| continue-on-error: true | |
| - name: Upload performance results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perf-results | |
| path: perf-results.json | |
| if-no-files-found: ignore | |
| retention-days: 30 |