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
|
run: dotnet run --project tests/Titano.App.Tests -c Release --no-build -- --junit out/junit/app.xml
|
||||||
|
|
||||||
- name: Screenshots
|
- 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
|
timeout-minutes: 10
|
||||||
run: |
|
run: |
|
||||||
set +e
|
set +e
|
||||||
@@ -148,17 +149,20 @@ jobs:
|
|||||||
screenshots:
|
screenshots:
|
||||||
name: Screenshots branch
|
name: Screenshots branch
|
||||||
# Same-repository pull requests only: forks never get a writable token.
|
# 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
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
|
# Absent when the build broke before the capture step: nothing to publish then.
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: screenshots
|
name: screenshots
|
||||||
path: screenshots
|
path: screenshots
|
||||||
- name: Publish to the ci-screenshots branch (one commit, overwritten each run)
|
- name: Publish to the ci-screenshots branch (one commit, overwritten each run)
|
||||||
|
if: hashFiles('screenshots/*.png') != ''
|
||||||
working-directory: screenshots
|
working-directory: screenshots
|
||||||
run: |
|
run: |
|
||||||
git init -q -b ci-screenshots
|
git init -q -b ci-screenshots
|
||||||
|
|||||||
Reference in new issue
Block a user