mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-09 17:19:02 +00:00
ci(release): report required Test checks on release PRs and auto-approve (#5250)
* ci(release): report required Test checks on release PRs and auto-approve Release-sync PRs skipped the matrix Test job at job level, so the required "Test (os, Node 22.x)" contexts were never reported and the PR could not merge. Move the skip to step level so the job still expands its matrix and concludes as a work-free pass. Also add a CI_DEV_BOT_PAT approval on the release PR to cover one of the two required reviews. * ci: single-quote the test job if expression for yamllint After dropping the inner 'true' comparison, double quotes are no longer required, so yamllint's quoted-strings rule wants single quotes.
This commit is contained in:
parent
bf5e928b1a
commit
cf0d9be585
2 changed files with 23 additions and 4 deletions
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
|
|
@ -155,7 +155,9 @@ jobs:
|
|||
test:
|
||||
name: 'Test (${{ matrix.os }}, Node ${{ matrix.node-version }})'
|
||||
needs: 'classify_pr'
|
||||
if: "${{ !cancelled() && needs.classify_pr.outputs.skip_ci != 'true' }}"
|
||||
# Stay running on release-sync PRs so the required Test contexts still
|
||||
# report; the per-step skip_ci guards below make them no-op (pass) there.
|
||||
if: '${{ !cancelled() }}'
|
||||
runs-on: '${{ matrix.os }}'
|
||||
permissions:
|
||||
contents: 'read'
|
||||
|
|
@ -176,9 +178,11 @@ jobs:
|
|||
upload-coverage: 'false'
|
||||
steps:
|
||||
- name: 'Checkout'
|
||||
if: "${{ needs.classify_pr.outputs.skip_ci != 'true' }}"
|
||||
uses: 'actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd' # v6.0.2
|
||||
|
||||
- name: 'Set up Node.js ${{ matrix.node-version }}'
|
||||
if: "${{ needs.classify_pr.outputs.skip_ci != 'true' }}"
|
||||
uses: 'actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e' # v6.4.0
|
||||
with:
|
||||
node-version: '${{ matrix.node-version }}'
|
||||
|
|
@ -187,6 +191,7 @@ jobs:
|
|||
registry-url: 'https://registry.npmjs.org/'
|
||||
|
||||
- name: 'Configure npm for rate limiting'
|
||||
if: "${{ needs.classify_pr.outputs.skip_ci != 'true' }}"
|
||||
run: |-
|
||||
npm config set fetch-retry-mintimeout 20000
|
||||
npm config set fetch-retry-maxtimeout 120000
|
||||
|
|
@ -194,17 +199,19 @@ jobs:
|
|||
npm config set fetch-timeout 300000
|
||||
|
||||
- name: 'Install dependencies'
|
||||
if: "${{ needs.classify_pr.outputs.skip_ci != 'true' }}"
|
||||
run: |-
|
||||
npm ci --prefer-offline --no-audit --progress=false
|
||||
|
||||
- name: 'Run tests and generate reports'
|
||||
if: "${{ needs.classify_pr.outputs.skip_ci != 'true' }}"
|
||||
env:
|
||||
NO_COLOR: true
|
||||
run: 'npm run test:ci'
|
||||
|
||||
- name: 'Publish Test Report (for non-forks)'
|
||||
if: |-
|
||||
${{ always() && (github.event.pull_request.head.repo.full_name == github.repository) }}
|
||||
${{ always() && needs.classify_pr.outputs.skip_ci != 'true' && (github.event.pull_request.head.repo.full_name == github.repository) }}
|
||||
uses: 'dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3' # ratchet:dorny/test-reporter@v2
|
||||
with:
|
||||
name: 'Test Results (${{ matrix.os }}, Node ${{ matrix.node-version }})'
|
||||
|
|
@ -214,7 +221,7 @@ jobs:
|
|||
|
||||
- name: 'Upload Test Results Artifact (for forks)'
|
||||
if: |-
|
||||
${{ always() && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
|
||||
${{ always() && needs.classify_pr.outputs.skip_ci != 'true' && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
|
||||
uses: 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a' # v7.0.1
|
||||
with:
|
||||
name: 'test-results-fork-${{ matrix.node-version }}-${{ matrix.os }}'
|
||||
|
|
@ -222,7 +229,7 @@ jobs:
|
|||
|
||||
- name: 'Upload coverage reports'
|
||||
if: |-
|
||||
${{ always() && matrix.upload-coverage == 'true' }}
|
||||
${{ always() && needs.classify_pr.outputs.skip_ci != 'true' && matrix.upload-coverage == 'true' }}
|
||||
uses: 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a' # v7.0.1
|
||||
with:
|
||||
name: 'coverage-reports-${{ matrix.node-version }}-${{ matrix.os }}'
|
||||
|
|
|
|||
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
|
|
@ -483,6 +483,18 @@ jobs:
|
|||
|
||||
echo "PR_URL=${pr_url}" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: 'Approve release PR'
|
||||
if: |-
|
||||
${{ needs.prepare.outputs.is_dry_run == 'false' && needs.prepare.outputs.is_nightly == 'false' && needs.prepare.outputs.is_preview == 'false' }}
|
||||
env:
|
||||
# Separate bot account from the PR author (CI_BOT_PAT) so GitHub
|
||||
# allows the approval; covers one of the two required reviews.
|
||||
GITHUB_TOKEN: '${{ secrets.CI_DEV_BOT_PAT }}'
|
||||
PR_URL: '${{ steps.pr.outputs.PR_URL }}'
|
||||
run: |-
|
||||
set -euo pipefail
|
||||
gh pr review "${PR_URL}" --approve --body "Automated approval for the release version bump."
|
||||
|
||||
- name: 'Enable auto-merge for release PR'
|
||||
if: |-
|
||||
${{ needs.prepare.outputs.is_dry_run == 'false' && needs.prepare.outputs.is_nightly == 'false' && needs.prepare.outputs.is_preview == 'false' }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue