-
Notifications
You must be signed in to change notification settings - Fork 8
101 lines (86 loc) · 3.02 KB
/
playwright.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Playwright
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
merge_group:
branches: [main]
# Concurrency is used to cancel other currently-running jobs, to preserve
# compute resources and cumulative build hours. (ie. If you push twice in a
# row, this will cancel the previous run.)
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
# This scopes the group to:
# - the same workflow,
# - the same event type, and
# - the same branch name
# e.g., my-workflow-pull_request-feature/123-my-thing
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
playwright:
name: Playwright
runs-on: ubuntu-22.04
env:
# Use native docker command within docker-compose
COMPOSE_DOCKER_CLI_BUILD: 1
# Use buildkit to speed up docker command
DOCKER_BUILDKIT: 1
PNPM_VERSION: "8.15.0"
steps:
# See: https://github.com/satackey/action-docker-layer-caching/issues/139#issuecomment-1007316528
- name: reclaim space on runner
run: rm -rf /usr/local/android /usr/share/dotnet /usr/local/share/boost /opt/ghc
- name: Checkout
uses: actions/checkout@v4
# We no longer user docker layer caching as it made runs take longer.
# See: https://github.com/satackey/action-docker-layer-caching/issues/305
- name: Serve app via docker-compose
# Need to include --build as we're caching layers.
run: docker-compose up --detach --build
- name: "Run: setup.sh"
run: docker-compose run --rm maintenance bash setup.sh -c
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Chromium Tests
run: pnpm run e2e:playwright:chromium
- uses: actions/upload-artifact@v4
if: always()
with:
name: chromium-report
path: apps/playwright/playwright-report/
retention-days: 30
- name: Run Firefox Tests
run: pnpm run e2e:playwright:firefox
- uses: actions/upload-artifact@v4
if: always()
with:
name: firefox-report
path: apps/playwright/playwright-report/
retention-days: 30
- name: Run Webkit Tests
run: pnpm run e2e:playwright:webkit
- uses: actions/upload-artifact@v4
if: always()
with:
name: webkit-report
path: apps/playwright/playwright-report/
retention-days: 30
- name: Check status of containers
if: failure()
run: docker-compose ps
- name: "Check logs: web server container"
if: failure()
run: docker-compose logs webserver