Fix upload of Develocity build scans

Don't tar them, as this was broken: we ended up uploading the
build-scan-data directory instead of the tar, while still expecting a
tar when dowloading, which made everything fail.

We don't need tars anyway, as workflow artifacts are already zipped.
This commit is contained in:
Yoann Rodière 2024-10-28 11:56:45 +01:00
parent b44833b7c9
commit 6551aa59c5
2 changed files with 4 additions and 10 deletions

View File

@ -66,11 +66,11 @@ jobs:
run: | run: |
shopt -s nullglob # Don't run the loop below if there are no artifacts shopt -s nullglob # Don't run the loop below if there are no artifacts
status=0 status=0
mkdir -p ~/.gradle/
for build_scan_data_directory in /tmp/downloaded-build-scan-data/* for build_scan_data_directory in /tmp/downloaded-build-scan-data/*
do do
rm -rf ~/.gradle/build-scan-data rm -rf ~/.gradle/build-scan-data
mkdir -p ~/.gradle/build-scan-data mv "$build_scan_data_directory" ~/.gradle/build-scan-data \
tar -xzf "$build_scan_data_directory/build-scan-data.tgz" -C ~/.gradle/build-scan-data \
&& ./gradlew --no-build-cache buildScanPublishPrevious || status=1 && ./gradlew --no-build-cache buildScanPublishPrevious || status=1
done done
exit $status exit $status

View File

@ -114,12 +114,9 @@ jobs:
POPULATE_REMOTE_GRADLE_CACHE: ${{ github.event_name == 'push' && github.repository == 'hibernate/hibernate-orm' && 'true' || 'false' }} POPULATE_REMOTE_GRADLE_CACHE: ${{ github.event_name == 'push' && github.repository == 'hibernate/hibernate-orm' && 'true' || 'false' }}
DEVELOCITY_ACCESS_KEY: "${{ secrets.DEVELOCITY_ACCESS_KEY }}" DEVELOCITY_ACCESS_KEY: "${{ secrets.DEVELOCITY_ACCESS_KEY }}"
# For jobs running on 'pull_request', tar and upload build scan data. # For jobs running on 'pull_request', upload build scan data.
# The actual publishing must be done in a separate job (see ci-report.yml). # The actual publishing must be done in a separate job (see ci-report.yml).
# We don't write to the remote cache as that would be unsafe. # We don't write to the remote cache as that would be unsafe.
- name: Tar build scan content pushed to subsequent jobs
if: "${{ github.event_name == 'pull_request' && !cancelled() }}"
run: tar -czf build-scan-data.tgz -C ~/.gradle/build-scan-data .
- name: Upload GitHub Actions artifact for the Develocity build scan - name: Upload GitHub Actions artifact for the Develocity build scan
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: "${{ github.event_name == 'pull_request' && !cancelled() }}" if: "${{ github.event_name == 'pull_request' && !cancelled() }}"
@ -219,13 +216,10 @@ jobs:
RUNID: ${{ github.run_number }} RUNID: ${{ github.run_number }}
run: ./ci/build-github.sh run: ./ci/build-github.sh
shell: bash shell: bash
# Tar and upload build scan data. # Upload build scan data.
# The actual publishing must be done in a separate job (see ci-report.yml). # The actual publishing must be done in a separate job (see ci-report.yml).
# We don't write to the remote cache as that would be unsafe. # We don't write to the remote cache as that would be unsafe.
# That's even on push, because we do not trust Atlas runners to hold secrets: they are shared infrastructure. # That's even on push, because we do not trust Atlas runners to hold secrets: they are shared infrastructure.
- name: Tar build scan content pushed to subsequent jobs
if: "${{ !cancelled() }}"
run: tar -czf build-scan-data.tgz -C ~/.gradle/build-scan-data .
- name: Upload GitHub Actions artifact for the Develocity build scan - name: Upload GitHub Actions artifact for the Develocity build scan
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: "${{ !cancelled() }}" if: "${{ !cancelled() }}"