-
Notifications
You must be signed in to change notification settings - Fork 15.2k
workflows/release-binaries: Run tests on the same runner as the build #162421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,40 +194,30 @@ | |
runs-on: ${{ needs.prepare.outputs.build-runs-on }} | ||
steps: | ||
|
||
- name: Checkout Actions | ||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
with: | ||
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }} | ||
sparse-checkout: | | ||
.github/workflows/ | ||
sparse-checkout-cone-mode: false | ||
# Check out outside of working directory so the source checkout doesn't | ||
# remove it. | ||
path: workflows | ||
|
||
# actions/checkout does not support paths outside of the GITHUB_WORKSPACE. | ||
# Also, anything that we put inside of GITHUB_WORKSPACE will be overwritten | ||
# by future actions/checkout steps. Therefore, in order to checkout the | ||
# latest actions from main, we need to first checkout out the actions inside of | ||
# GITHUB_WORKSPACE (see previous step), then use actions/checkout to checkout | ||
# the code being built and the move the actions from main back into GITHUB_WORKSPACE, | ||
# becasue the uses on composite actions only reads workflows from inside GITHUB_WORKSPACE. | ||
- shell: bash | ||
run: mv workflows ../workflows-main | ||
|
||
- name: Checkout LLVM | ||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
with: | ||
ref: ${{ needs.prepare.outputs.ref }} | ||
|
||
- name: Copy main workflows | ||
shell: bash | ||
run: | | ||
mv ../workflows-main . | ||
- name: Install Ninja | ||
uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main | ||
|
||
- name: Setup Windows | ||
if: startsWith(runner.os, 'Windows') | ||
uses: llvm/actions/setup-windows@main | ||
with: | ||
arch: amd64 | ||
|
||
- name: Setup Stage | ||
- name: Set Build Prefix | ||
id: setup-stage | ||
uses: ./workflows-main/.github/workflows/release-binaries-setup-stage | ||
shell: bash | ||
run: | | ||
build_prefix=`pwd` | ||
if [ "${{ runner.os }}" = "Linux" ]; then | ||
sudo chown $USER:$USER /mnt/ | ||
build_prefix=/mnt/ | ||
fi | ||
echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT | ||
|
||
- name: Configure | ||
id: build | ||
|
@@ -240,7 +230,7 @@ | |
cmake -G Ninja -S llvm -B ${{ steps.setup-stage.outputs.build-prefix }}/build \ | ||
${{ needs.prepare.outputs.target-cmake-flags }} \ | ||
-C clang/cmake/caches/Release.cmake \ | ||
-DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \ | ||
-DBOOTSTRAP_BOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" | ||
|
||
- name: Build | ||
|
@@ -258,17 +248,11 @@ | |
path: | | ||
${{ needs.prepare.outputs.release-binary-filename }} | ||
|
||
# Clean up some build files to reduce size of artifact. | ||
- name: Clean Up Build Directory | ||
shell: bash | ||
- name: Run Tests | ||
# These almost always fail so don't let them fail the build and prevent the uploads. | ||
continue-on-error: true | ||
run: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should you also to specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bash is the default shell for Linux and Mac, so I don't think it's necessary. I think the other jobs have it from when we used to do Windows builds and had to explicitly select bash as the shell. |
||
find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname ${{ needs.prepare.outputs.release-binary-filename }} -delete | ||
find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname _CPack_Packages -prune -exec rm -r {} + | ||
|
||
- name: Save Stage | ||
uses: ./workflows-main/.github/workflows/release-binaries-save-stage | ||
with: | ||
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }} | ||
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all | ||
|
||
upload-release-binaries: | ||
name: "Upload Release Binaries" | ||
|
@@ -327,31 +311,3 @@ | |
--release ${{ needs.prepare.outputs.release-version }} \ | ||
upload \ | ||
--files ${{ needs.prepare.outputs.release-binary-filename }}* | ||
|
||
test-release: | ||
name: "Test Release" | ||
needs: | ||
- prepare | ||
- build-release-package | ||
if: >- | ||
github.repository_owner == 'llvm' | ||
runs-on: ${{ needs.prepare.outputs.test-runs-on }} | ||
steps: | ||
- name: Checkout Actions | ||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
with: | ||
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }} | ||
sparse-checkout: | | ||
.github/workflows/ | ||
sparse-checkout-cone-mode: false | ||
path: workflows | ||
- name: Setup Stage | ||
id: setup-stage | ||
uses: ./workflows/.github/workflows/release-binaries-setup-stage | ||
with: | ||
previous-artifact: build-release-package | ||
|
||
- name: Run Tests | ||
shell: bash | ||
run: | | ||
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium