Skip to content

Commit 72393de

Browse files
committed
ci/deploy: only upload the playwright report if the tests actually ran
Otherwise it does not make much sense trying to upload the results. Not that it matters much: If the file does not exist, there will be a warning and nothing gets uploaded anyway. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 08c24b2 commit 72393de

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/actions/deploy-to-github-pages/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ runs:
198198
run: sudo sh -c 'echo "185.199.108.153 git-scm.com" >>/etc/hosts'
199199
- name: Run Playwright tests
200200
shell: bash
201+
id: playwright
201202
env:
202203
PLAYWRIGHT_TEST_URL: ${{ steps.pages.outputs.base_url }}
203204
run: |
@@ -206,9 +207,10 @@ runs:
206207
https://*|http://git-scm.com) ;; # okay, leave as-is
207208
http://*) PLAYWRIGHT_TEST_URL="https://${PLAYWRIGHT_TEST_URL#http://}";;
208209
esac &&
210+
echo "result=$PLAYWRIGHT_TEST_URL" >>$GITHUB_OUTPUT &&
209211
npx playwright test --project=chrome
210212
- uses: actions/upload-artifact@v4
211-
if: always()
213+
if: always() && steps.playwright.outputs.result != ''
212214
with:
213215
name: playwright-report
214216
path: playwright-report/

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ jobs:
7979
- name: Install @playwright/test
8080
run: npm install @playwright/test
8181
- name: Run Playwright tests
82+
id: playwright
8283
env:
8384
PLAYWRIGHT_TEST_URL: http://localhost:5000/
84-
run: npx playwright test --project=chrome
85+
run: |
86+
echo "result=$PLAYWRIGHT_TEST_URL" >>$GITHUB_OUTPUT &&
87+
npx playwright test --project=chrome
8588
- uses: actions/upload-artifact@v4
86-
if: always()
89+
if: always() && steps.playwright.outputs.result != ''
8790
with:
8891
name: playwright-report
8992
path: playwright-report/

0 commit comments

Comments
 (0)