20
20
- ' .github/workflows/app-tests.yaml'
21
21
- ' .github/workflows/unit-tests.yaml'
22
22
23
+ concurrency :
24
+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
25
+ cancel-in-progress : true
26
+
23
27
jobs :
24
- js :
28
+ test :
25
29
runs-on : ubuntu-latest
30
+ strategy :
31
+ fail-fast : false
32
+ matrix :
33
+ symfony : ['6.4.*', '7.3.*']
34
+ env :
35
+ SYMFONY_REQUIRE : ' ${{ matrix.symfony }}'
26
36
steps :
27
37
- uses : actions/checkout@v4
38
+
28
39
- run : npm i -g corepack && corepack enable
29
40
- uses : actions/setup-node@v4
30
41
with :
@@ -33,21 +44,73 @@ jobs:
33
44
cache-dependency-path : |
34
45
pnpm-lock.yaml
35
46
package.json
36
- src/**/package.json
37
- - run : pnpm install --frozen-lockfile
38
47
39
- - name : Install custom browsers
40
- run : node ./bin/get_browsers.mjs
48
+ - name : Install root JS dependencies
49
+ run : pnpm install --frozen-lockfile
50
+
51
+ - name : Install custom browsers
52
+ run : node ./bin/get_browsers.mjs
53
+
54
+ - name : Install browsers with Playwright
55
+ run : pnpm exec playwright install firefox ffmpeg
56
+
57
+ - uses : shivammathur/setup-php@v2
58
+ with :
59
+ php-version : 8.2
60
+ tools : symfony-cli, flex
61
+
62
+ - name : Install root PHP dependencies
63
+ uses : ramsey/composer-install@v3
64
+ with :
65
+ working-directory : ${{ github.workspace }}
66
+
67
+ - name : Build root packages
68
+ run : php .github/build-packages.php
41
69
42
- - name : Install browsers with Playwright
43
- run : pnpm exec playwright install firefox ffmpeg
70
+ - name : Start Docker containers
71
+ run : docker compose up -d --build
72
+ working-directory : test_apps/e2e-app
44
73
45
- # TODO: Install the E2E app + run webserver
46
- - run : pnpm run test:browser
74
+ - name : Configure E2E app
75
+ run : |
76
+ echo 'APP_ENV=prod' >> .env.local
77
+ echo 'APP_DEBUG=0' >> .env.local
78
+ working-directory : test_apps/e2e-app
79
+
80
+ - name : Install E2E PHP dependencies
81
+ uses : ramsey/composer-install@v3
82
+ with :
83
+ working-directory : test_apps/e2e-app
84
+ dependency-versions : highest
85
+ composer-options : --no-dev
86
+ custom-cache-suffix : symfony-${{ matrix.symfony }}
87
+
88
+ - name : Prepare E2E app
89
+ run : |
90
+ symfony composer dump-autoload --classmap-authoritative --no-dev
91
+ symfony composer dump-env
92
+ symfony console asset-map:compile
93
+ symfony console ux:icons:warm-cache
94
+ working-directory : test_apps/e2e-app
95
+
96
+ - name : Start E2E app
97
+ run : symfony serve --daemon
98
+ working-directory : test_apps/e2e-app
99
+
100
+ - name : Run browser tests
101
+ run : pnpm run test:browser
102
+ id : browser-tests
103
+
104
+ - uses : actions/upload-artifact@v4
105
+ if : ${{ always() && steps.browser-tests.conclusion == 'failure' }}
106
+ with :
107
+ name : Playwright report
108
+ path : src/**/asset/.playwright-report/
109
+ retention-days : 7
47
110
48
111
- uses : actions/upload-artifact@v4
49
- if : ${{ !cancelled() }}
112
+ if : ${{ always() && steps.browser-tests.conclusion == 'failure' }}
50
113
with :
51
- name : playwright-report
52
- path : .playwright-report /
114
+ name : Symfony logs
115
+ path : test_apps/e2e-app/var/log /
53
116
retention-days : 7
0 commit comments