1616 playwright :
1717 name : Run Playwright
1818 runs-on : ubuntu-latest
19+ container :
20+ image : mcr.microsoft.com/playwright:v1.55.1-jammy
1921 steps :
2022 # Checkout the repository so the workflow has access to the code
2123 - name : Checkout code
@@ -25,34 +27,19 @@ jobs:
2527 with :
2628 hugo-version : ' 0.147.8'
2729 extended : true
30+ - uses : actions/setup-go@v6
31+ with :
32+ go-version : ' 1.24.6'
2833 - name : Install dependencies
2934 run : cd tests && npm ci
30- - name : Check playwright version
31- id : check-playwright-version
32- run : |
33- cd tests
34- version=$(npm list @playwright/test --json | jq -r '.dependencies["@playwright/test"].version')
35- echo "version=$version" >> $GITHUB_OUTPUT
36- - name : Attempt to restore cache
37- uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
38- id : restore-cache
39- with :
40- # By default this path is hardcoded by OS - https://playwright.dev/python/docs/browsers#managing-browser-binaries
41- path : ' ~/.cache/ms-playwright'
42- key : ' ${{ runner.os }}-playwright-${{ steps.check-playwright-version.outputs.version }}'
43- # Fallback, if version changed, use the most recent cached version.
44- restore-keys : |
45- ${{ runner.os }}-playwright-
46- - name : Install playwright with dependencies
47- if : steps.restore-cache.outputs.cache-hit != 'true'
48- run : cd tests && npx playwright install --with-deps ${{ env.BROWSERS }} --only-shell
49- - name : Install playwright dependencies
50- if : steps.restore-cache.outputs.cache-hit == 'true'
51- run : cd tests && npx playwright install-deps ${{ env.BROWSERS }}
5235 - name : Run Playwright tests
5336 id : test-ui
37+ if : ${{ runner.os == 'Linux' }}
38+ env :
39+ HOME : /root
5440 run : |
55- make tests | tee output.log
41+ git config --global --add safe.directory /__w/nginx-hugo-theme/nginx-hugo-theme
42+ cd tests && npx playwright test | tee output.log
5643 if grep -q "failed" output.log; then
5744 echo "Playwright tests failed. Please view the Playwright report to see full error."
5845 exit 1
0 commit comments