Skip to content

Commit 94f74fe

Browse files
committed
ci: make junit reporting robust in smart test mode
1 parent 658d4b8 commit 94f74fe

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

.github/workflows/bootstrap.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,19 @@ jobs:
143143
retention-days: 7
144144
if-no-files-found: ignore
145145

146-
- name: Publish Test Report
146+
- name: Detect JUnit Test Report
147147
if: always()
148+
id: junit
149+
shell: bash
150+
run: |
151+
if [ -f target/nextest/commit/junit.xml ]; then
152+
echo "found=true" >> "$GITHUB_OUTPUT"
153+
else
154+
echo "found=false" >> "$GITHUB_OUTPUT"
155+
fi
156+
157+
- name: Publish Test Report
158+
if: always() && steps.junit.outputs.found == 'true'
148159
uses: mikepenz/action-junit-report@74626db7353a25a20a72816467ebf035f674c5f8 # v6.2.0
149160
with:
150161
report_paths: 'target/nextest/commit/junit.xml'

.github/workflows/commit.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,19 @@ jobs:
179179
retention-days: 7
180180
if-no-files-found: ignore
181181

182-
- name: Publish Test Report
182+
- name: Detect JUnit Test Report
183183
if: always()
184+
id: junit
185+
shell: bash
186+
run: |
187+
if [ -f target/nextest/commit/junit.xml ]; then
188+
echo "found=true" >> "$GITHUB_OUTPUT"
189+
else
190+
echo "found=false" >> "$GITHUB_OUTPUT"
191+
fi
192+
193+
- name: Publish Test Report
194+
if: always() && steps.junit.outputs.found == 'true'
184195
uses: mikepenz/action-junit-report@74626db7353a25a20a72816467ebf035f674c5f8 # v6.2.0
185196
with:
186197
report_paths: 'target/nextest/commit/junit.xml'

scripts/test/test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,9 @@ cargo rail plan $PLAN_ARGS --explain
5959
echo ""
6060

6161
echo "Testing affected crates..."
62-
cargo rail run $PLAN_ARGS --surface test
62+
if [ "$MODE" = "commit" ]; then
63+
# CI mode: force commit profile and nextest JUnit output path.
64+
cargo rail run $PLAN_ARGS --surface test -- -P "$NEXTEST_PROFILE" --config-file .config/nextest.toml
65+
else
66+
cargo rail run $PLAN_ARGS --surface test
67+
fi

0 commit comments

Comments
 (0)