Skip to content

Commit bab1ce4

Browse files
committed
ci: update workflows to upload and download test results for site generation
1 parent fd60d92 commit bab1ce4

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.github/workflows/build-test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ jobs:
7171
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.path }}
7272
run: mvn verify
7373

74-
- name: Upload JaCoCo exec for site generation
74+
- name: Upload test results for site generation
7575
if: success() && github.ref == 'refs/heads/main'
7676
uses: actions/upload-artifact@v4
7777
with:
78-
name: jacoco-exec
79-
path: target/jacoco-test-results/sdk-tests.exec
78+
name: test-results-for-site
79+
path: |
80+
target/jacoco-test-results/sdk-tests.exec
81+
target/surefire-reports/
8082
retention-days: 1
8183

8284
- name: Generate Test Report Summary

.github/workflows/deploy-site.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ jobs:
111111
echo "is_release=false" >> $GITHUB_OUTPUT
112112
fi
113113
114-
- name: Download JaCoCo exec from Build & Test
114+
- name: Download test results from Build & Test
115115
if: steps.tags.outputs.is_release == 'false' && inputs.rebuild_all_versions != true && github.event_name == 'workflow_run'
116116
uses: actions/download-artifact@v4
117117
with:
118-
name: jacoco-exec
119-
path: /tmp/jacoco-exec
118+
name: test-results-for-site
119+
path: /tmp/test-results
120120
run-id: ${{ github.event.workflow_run.id }}
121121
github-token: ${{ secrets.GITHUB_TOKEN }}
122122
continue-on-error: true
@@ -127,14 +127,13 @@ jobs:
127127
# Compile sources (needed for javadoc and other reports)
128128
./mvnw clean compile -DskipTests -Dcheckstyle.skip=true
129129
130-
# Restore JaCoCo exec if available from Build & Test
131-
if [ -f "/tmp/jacoco-exec/sdk-tests.exec" ]; then
132-
mkdir -p target/jacoco-test-results
133-
cp /tmp/jacoco-exec/sdk-tests.exec target/jacoco-test-results/
134-
echo "JaCoCo exec restored — coverage report will be included"
130+
# Restore test results from Build & Test (for JaCoCo + Surefire reports)
131+
if [ -d "/tmp/test-results/target" ]; then
132+
cp -r /tmp/test-results/target/* target/
133+
echo "Test results restored — JaCoCo and Surefire reports will be included"
135134
fi
136135
137-
# Generate site (JaCoCo report plugin picks up the exec file)
136+
# Generate site (report plugins pick up the restored data)
138137
./mvnw site -DskipTests -Dcheckstyle.skip=true
139138
140139
rm -rf "site/snapshot"

0 commit comments

Comments
 (0)