forked from symfony/ux
-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (100 loc) · 4.16 KB
/
browser-tests.yml
File metadata and controls
119 lines (100 loc) · 4.16 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Browser Tests
defaults:
run:
shell: bash
on:
push:
branches-ignore:
- 'dependabot/**'
paths-ignore:
- '.github/workflows/app-tests.yaml'
- '.github/workflows/unit-tests.yaml'
- 'src/*/doc/**'
- 'src/**/*.md'
pull_request:
paths-ignore:
- '.github/workflows/app-tests.yaml'
- '.github/workflows/unit-tests.yaml'
- 'src/*/doc/**'
- 'src/**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
symfony: ['6.4', '7.4', '8.0']
env:
SYMFONY_REQUIRE: '${{ matrix.symfony }}.*'
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
- run: npm i -g corepack && corepack enable
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
cache-dependency-path: |
pnpm-lock.yaml
package.json
- name: Install root JS dependencies
run: pnpm install --frozen-lockfile
- name: Install custom browsers
run: node ./bin/get_browsers.mjs
- name: Install browsers with Playwright
run: pnpm exec playwright install firefox ffmpeg
- uses: shivammathur/setup-php@690cb7c9d81dbfe51eba732cfca0a00ca42db777
with:
php-version: ${{ matrix.symfony >= '8.0' && '8.4' || '8.2' }}
tools: symfony-cli, flex
- name: Install root PHP dependencies
uses: ramsey/composer-install@5c2bcf28d7b060ef3c601d7b476d5430a7b46c27
with:
working-directory: ${{ github.workspace }}
- name: Build root PHP packages
run: php .github/build-packages.php
- name: Start Docker containers
run: docker compose up -d --build
working-directory: apps/e2e
- name: Configure E2E app
run: |
echo 'APP_SECRET=df4c071596e64cc75a349456f2887ae2419ae650' >> .env.local
working-directory: apps/e2e
- name: Install E2E PHP dependencies
uses: ramsey/composer-install@5c2bcf28d7b060ef3c601d7b476d5430a7b46c27
with:
working-directory: apps/e2e
dependency-versions: highest
custom-cache-suffix: symfony-${{ matrix.symfony }}
- name: Prepare E2E app
run: |
echo 'APP_ENV=prod' >> .env.local
echo 'APP_DEBUG=0' >> .env.local
symfony composer dump-autoload --classmap-authoritative --no-dev
symfony composer dump-env
symfony console asset-map:compile
symfony console ux:icons:warm-cache
working-directory: apps/e2e
- name: Start E2E app
run: symfony serve --daemon
working-directory: apps/e2e
- name: Run browser tests
run: pnpm run test:browser
id: browser-tests
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
if: ${{ always() && steps.browser-tests.conclusion == 'failure' }}
with:
name: Playwright report and output (${{ matrix.symfony }})
path: |
src/**/assets/.playwright-report/
src/**/assets/.playwright-output/
retention-days: 7
include-hidden-files: true
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
if: ${{ always() && steps.browser-tests.conclusion == 'failure' }}
with:
name: Symfony logs (${{ matrix.symfony }})
path: apps/e2e/var/log/
retention-days: 7