Skip to content

Commit

Permalink
Skip cargo bench job on release (#51311)
Browse files Browse the repository at this point in the history
This fails when run during a release since the new version isn't
published yet

x-ref:
https://github.com/vercel/next.js/actions/runs/5266469610/jobs/9520466217
  • Loading branch information
ijjk committed Jun 14, 2023
1 parent 9a36f33 commit 3ec70a2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
skipForDocsOnly: 'yes'
skipForRelease: 'yes'
needsRust: 'yes'
skipNativeBuild: 'yes'
afterBuild: xvfb-run turbo run test-cargo-bench
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
required: false
description: 'skip for docs only changes'
type: string
skipForRelease:
required: false
description: 'skip for release'
type: string
nodeVersion:
required: false
description: 'version of Node.js to use'
Expand Down Expand Up @@ -103,6 +107,15 @@ jobs:
name: check docs only change
id: docs-change

- id: is-release
run: |
if [[ $(node ./scripts/check-is-release.js 2> /dev/null || :) = v* ]];
then
echo "IS_RELEASE=yes" >> $GITHUB_OUTPUT
else
echo "IS_RELEASE=nope" >> $GITHUB_OUTPUT
fi
# normalize versions before build-native for better cache hits
- run: node scripts/normalize-version-bump.js
name: normalize versions
Expand Down Expand Up @@ -138,7 +151,7 @@ jobs:
- run: turbo run get-test-timings -- --build ${{ github.sha }}

- run: /bin/bash -c "${{ inputs.afterBuild }}"
if: ${{inputs.skipForDocsOnly != 'yes' || steps.docs-change.outputs.DOCS_CHANGE == 'nope'}}
if: ${{(inputs.skipForDocsOnly != 'yes' || steps.docs-change.outputs.DOCS_CHANGE == 'nope') && (inputs.skipForRelease != 'yes' || steps.is-release.outputs.IS_RELEASE == 'nope')}}

- name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 3ec70a2

Please sign in to comment.