From 27c27bcd100d9953483cea340abdc5b07c927c4e Mon Sep 17 00:00:00 2001 From: Alison Cheng Date: Tue, 13 Oct 2026 14:40:19 -0700 Subject: [PATCH 1/2] record CI step outcomes for PR test summary --- .github/workflows/test-summary.yml | 23 ++++++++++++++--------- .github/workflows/test.yml | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-summary.yml b/.github/workflows/test-summary.yml index 1c6337f5..a9e232ab 100644 --- a/.github/workflows/test-summary.yml +++ b/.github/workflows/test-summary.yml @@ -62,15 +62,20 @@ jobs: const emoji = testStatus === 'success' ? '✅' : '❌'; const message = testStatus === 'success' ? 'All tests passed!' : 'Some tests failed.'; - // Get the job outputs to determine individual step results - const jobs = await github.rest.actions.listJobsForWorkflowRun({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{ github.event.workflow_run.id }}, - }); - - const testJob = jobs.data.jobs.find(job => job.name.includes('test')); - const steps = testJob ? testJob.steps : []; + // Prefer step outcomes recorded by the test workflow; the jobs API + // sometimes returns an empty steps array. + let steps = []; + try { + steps = JSON.parse(fs.readFileSync('step-outcomes.json', 'utf8')); + } catch (e) { + const jobs = await github.rest.actions.listJobsForWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{ github.event.workflow_run.id }}, + }); + const testJob = jobs.data.jobs.find(job => job.name.includes('test')); + steps = testJob ? testJob.steps : []; + } const lintStep = steps.find(step => step.name === 'Run linting'); const formatStep = steps.find(step => step.name === 'Run formatting check'); diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 894686d9..3d1dfdbe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,22 +28,26 @@ jobs: run: npm ci - name: Run linting + id: lint run: | npm run lint 2>&1 | tee lint-output.txt exit ${PIPESTATUS[0]} continue-on-error: true - name: Run formatting check + id: format run: | npm run format 2>&1 | tee format-output.txt exit ${PIPESTATUS[0]} continue-on-error: true - name: Run type checking and build + id: build run: npm run build continue-on-error: false - name: Run specific test suites + id: tests run: | echo "Running individual test suites for better visibility..." npm run test:run -- src/testing/tests/BeamEnergy.test.tsx @@ -127,6 +131,19 @@ jobs: env: CI: true + # Record step outcomes ourselves; the jobs API sometimes returns no step data. + - name: Record step outcomes + if: always() + run: | + cat > step-outcomes.json < Date: Tue, 13 Oct 2026 14:45:40 -0700 Subject: [PATCH 2/2] Address node and ubuntu warnings --- .github/workflows/test-summary.yml | 6 +++--- .github/workflows/test.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-summary.yml b/.github/workflows/test-summary.yml index a9e232ab..d86929c9 100644 --- a/.github/workflows/test-summary.yml +++ b/.github/workflows/test-summary.yml @@ -11,7 +11,7 @@ permissions: jobs: comment: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: github.event.workflow_run.event == 'pull_request' steps: @@ -30,7 +30,7 @@ jobs: - name: Download test artifacts if: steps.pr.outputs.number != '' - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: test-results-node-20.x run-id: ${{ github.event.workflow_run.id }} @@ -39,7 +39,7 @@ jobs: - name: Comment PR with test summary if: steps.pr.outputs.number != '' - uses: actions/github-script@v6 + uses: actions/github-script@v9 with: script: | const fs = require('fs'); diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d1dfdbe..734eb959 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: @@ -16,10 +16,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: node-version: ${{ matrix.node-version }} cache: 'npm' @@ -145,7 +145,7 @@ jobs: EOF - name: Upload test results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 if: always() with: name: test-results-node-${{ matrix.node-version }}