Skip to content

Commit

Permalink
ci/deploy: only upload the playwright report if the tests actually ran
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Oct 9, 2024
1 parent 7f95c9a commit dc829f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/actions/deploy-to-github-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ runs:
run: sudo sh -c 'echo "185.199.108.153 git-scm.com" >>/etc/hosts'
- name: Run Playwright tests
shell: bash
id: playwright
env:
PLAYWRIGHT_TEST_URL: ${{ steps.pages.outputs.base_url }}
run: |
Expand All @@ -206,9 +207,10 @@ runs:
https://*|http://git-scm.com) ;; # okay, leave as-is
http://*) PLAYWRIGHT_TEST_URL="https://${PLAYWRIGHT_TEST_URL#http://}";;
esac &&
echo "result=$PLAYWRIGHT_TEST_URL" >>$GITHUB_OUTPUT &&
npx playwright test --project=chrome
- uses: actions/upload-artifact@v4
if: always()
if: always() && steps.playwright.outputs.result != ''
with:
name: playwright-report
path: playwright-report/
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@ jobs:
- name: Install @playwright/test
run: npm install @playwright/test
- name: Run Playwright tests
id: playwright
env:
PLAYWRIGHT_TEST_URL: http://localhost:5000/
run: npx playwright test --project=chrome
run: |
echo "result:$PLAYWRIGHT_TEST_URL" >>$GITHUB_OUTPUT &&
npx playwright test --project=chrome
- uses: actions/upload-artifact@v4
if: always()
if: always() && steps.playwright.outputs.result != ''
with:
name: playwright-report
path: playwright-report/

0 comments on commit dc829f3

Please sign in to comment.