Skip to content

Commit 960ff67

Browse files
committed
chore(ci): fail registry tests without summary
1 parent 31ef9aa commit 960ff67

14 files changed

Lines changed: 1029 additions & 365 deletions

File tree

.github/workflows/registry.yml

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,41 +169,78 @@ jobs:
169169
TEST_TRANCHE: ${{ matrix.tranche }}
170170
TEST_TRANCHE_COUNT: ${{ needs.list-changed-tools.outputs.tools == '' && 8 || 1 }}
171171
run: |
172+
summary_dir="$RUNNER_TEMP/test-tool-${{ matrix.tranche }}"
173+
rm -rf "$summary_dir"
174+
mkdir -p "$summary_dir"
175+
chmod 777 "$summary_dir"
176+
summary_file="$summary_dir/summary.md"
177+
178+
set +e
172179
docker run --rm \
173180
-v "$PWD:/mise-src:ro" \
174181
-v "$PWD/target/debug/mise:/usr/local/bin/mise:ro" \
175-
-v "$GITHUB_STEP_SUMMARY:/tmp/github_summary" \
182+
-v "$summary_dir:/tmp/github-summary" \
176183
-e GITHUB_TOKEN="${POOL_TOKEN:-}" \
177-
-e GITHUB_STEP_SUMMARY=/tmp/github_summary \
184+
-e GITHUB_STEP_SUMMARY=/tmp/github-summary/summary.md \
178185
-e TEST_TRANCHE="$TEST_TRANCHE" \
179186
-e TEST_TRANCHE_COUNT="$TEST_TRANCHE_COUNT" \
180187
-e MISE_EXPERIMENTAL=1 \
181188
-e MISE_LOCKFILE=1 \
182189
-e MISE_USE_VERSIONS_HOST_TRACK=0 \
183190
-e RUST_BACKTRACE=1 \
184191
ghcr.io/jdx/mise:e2e \
185-
mise test-tool ${{ needs.list-changed-tools.outputs.tools == '' && '--all' || needs.list-changed-tools.outputs.tools }} || true
186-
failed_tools=$(grep "Failed Tools" "$GITHUB_STEP_SUMMARY" | sed 's/\*\*Failed Tools\*\*: //' | tr ',' ' ')
192+
mise test-tool ${{ needs.list-changed-tools.outputs.tools == '' && '--all' || needs.list-changed-tools.outputs.tools }}
193+
test_tool_status=$?
194+
set -e
195+
196+
if [ -f "$summary_file" ]; then
197+
cat "$summary_file" >> "$GITHUB_STEP_SUMMARY"
198+
failed_tools=$(grep "Failed Tools" "$summary_file" | sed 's/\*\*Failed Tools\*\*: //' | tr ',' ' ' || true)
199+
else
200+
failed_tools=""
201+
fi
187202
echo "failed_tools=$failed_tools" >> "$GITHUB_OUTPUT"
203+
if [ "$test_tool_status" -ne 0 ] && [ -z "$failed_tools" ]; then
204+
echo "::error::mise test-tool exited with status $test_tool_status without reporting failed tools"
205+
exit "$test_tool_status"
206+
fi
188207
- name: Retry failed tools
189208
id: retry
190209
if: steps.test-tools.outputs.failed_tools != ''
191210
run: |
192-
summary_lines=$(wc -l < "$GITHUB_STEP_SUMMARY")
211+
summary_dir="$RUNNER_TEMP/test-tool-retry-${{ matrix.tranche }}"
212+
rm -rf "$summary_dir"
213+
mkdir -p "$summary_dir"
214+
chmod 777 "$summary_dir"
215+
summary_file="$summary_dir/summary.md"
216+
217+
set +e
193218
docker run --rm \
194219
-v "$PWD:/mise-src:ro" \
195220
-v "$PWD/target/debug/mise:/usr/local/bin/mise:ro" \
196-
-v "$GITHUB_STEP_SUMMARY:/tmp/github_summary" \
221+
-v "$summary_dir:/tmp/github-summary" \
197222
-e GITHUB_TOKEN="${POOL_TOKEN:-}" \
198-
-e GITHUB_STEP_SUMMARY=/tmp/github_summary \
223+
-e GITHUB_STEP_SUMMARY=/tmp/github-summary/summary.md \
199224
-e MISE_EXPERIMENTAL=1 \
200225
-e MISE_LOCKFILE=1 \
201226
-e MISE_USE_VERSIONS_HOST_TRACK=0 \
202227
-e RUST_BACKTRACE=1 \
203228
ghcr.io/jdx/mise:e2e \
204-
mise test-tool ${{ steps.test-tools.outputs.failed_tools }} || true
205-
failed_tools=$(tail -n "+$((summary_lines+1))" "$GITHUB_STEP_SUMMARY" | grep "Failed Tools" | sed 's/\*\*Failed Tools\*\*: //' | tr ',' ' ')
229+
mise test-tool ${{ steps.test-tools.outputs.failed_tools }}
230+
test_tool_status=$?
231+
set -e
232+
233+
if [ -f "$summary_file" ]; then
234+
cat "$summary_file" >> "$GITHUB_STEP_SUMMARY"
235+
failed_tools=$(grep "Failed Tools" "$summary_file" | sed 's/\*\*Failed Tools\*\*: //' | tr ',' ' ' || true)
236+
else
237+
failed_tools=""
238+
fi
206239
echo "failed_tools=$failed_tools" >> "$GITHUB_OUTPUT"
240+
if [ "$test_tool_status" -ne 0 ] && [ -z "$failed_tools" ]; then
241+
echo "::error::mise test-tool retry exited with status $test_tool_status without reporting failed tools"
242+
exit "$test_tool_status"
243+
fi
207244
- name: Handle retry failures
208245
if: steps.retry.outputs.failed_tools != '' && github.head_ref != 'release' && github.ref != 'refs/heads/release'
209246
run: |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"repository": "aquaproj/aqua-registry",
3-
"tag": "v4.501.0"
3+
"tag": "v4.505.0"
44
}

0 commit comments

Comments
 (0)