-
-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (49 loc) · 1.59 KB
/
playwright-e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: 🧪 Playwright End To End (e2e) Tests Workflow
on:
push:
branches: [ main ]
pull_request:
branches: [ main, develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout
uses: actions/checkout@v4
- name: 🛠️ Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
# Using the latest value doesn't work for now.
# See https://github.com/peaceiris/actions-hugo/issues/652#issuecomment-2543985304
# and https://github.com/peaceiris/actions-hugo/issues/662
hugo-version: '0.139.4'
extended: true
- name: 🧱 Hugo build
run: hugo --gc --config ./config.toml -b http://127.0.0.1:1313
- name: 🕸️ Run server
run: |
cd public && python -m http.server 1313 &
- name: Test hugo endpoint
run: |
curl -v http://127.0.0.1:1313
if [ $? -ne 0 ]; then
echo "Curl command failed"
exit 1
fi
- name: 👨👩👧 Install playwright dependencies
working-directory: playwright/ci-test
run: |
npm install
npm ci
npx playwright install --with-deps
- name: ⚡️ Run Playwright tests
working-directory: playwright/ci-test
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright/ci-test/playwright-report/
retention-days: 30