ci: capture and publish screenshots even when a test step fails
The pictures are what explains a failing screen test; the publish job skips quietly when the build broke before the capture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
1 file changed
+6
-2
@@ -94,7 +94,8 @@ jobs:
|
||||
run: dotnet run --project tests/Titano.App.Tests -c Release --no-build -- --junit out/junit/app.xml
|
||||
|
||||
- name: Screenshots
|
||||
if: runner.os == 'Windows'
|
||||
# Also after a failed test step: the pictures are what explains a failing screen test.
|
||||
if: runner.os == 'Windows' && !cancelled()
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
set +e
|
||||
@@ -148,17 +149,20 @@ jobs:
|
||||
screenshots:
|
||||
name: Screenshots branch
|
||||
# Same-repository pull requests only: forks never get a writable token.
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
||||
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
# Absent when the build broke before the capture step: nothing to publish then.
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: screenshots
|
||||
path: screenshots
|
||||
- name: Publish to the ci-screenshots branch (one commit, overwritten each run)
|
||||
if: hashFiles('screenshots/*.png') != ''
|
||||
working-directory: screenshots
|
||||
run: |
|
||||
git init -q -b ci-screenshots
|
||||
|
||||
Reference in new issue
Block a user