-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (98 loc) · 3.08 KB
/
test.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
102
103
104
105
106
107
108
109
110
name: Test
on:
push:
branches:
- '**'
env:
APP_ENV: test
APP_SECRET: bafc23a0315b735289c499a886798934
APP_DEBUG: false
DATABASE_URL: pgsql://precontentieux:precontentieux@localhost:5432/precontest?serverVersion=15
PRECONTENTIEUX_COURRIEL_EQUIPE: [email protected]
COMPOSER_ALLOW_SUPERUSER: 1
BASE_URL: precontentieux.test
MAILER_FROM: [email protected]
MAILER_DSN: smtp://localhost:1025
MAILPIT_URL: http://localhost:8025
CORS_ALLOW_ORIGIN: "*"
EMAIL_FROM: [email protected]
EMAIL_FROM_LABEL: "Mon Indemnisation Justice (test)"
SYMFONY_DEPRECATIONS_HELPER: disabled
PANTHER_ERROR_SCREENSHOT_DIR: public/screenshots
PANTHER_ERROR_SCREENSHOT_ATTACH: true
permissions:
contents: read
issues: read
checks: write
pull-requests: write
jobs:
test:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: precontentieux
POSTGRES_DB: precontest
POSTGRES_HOST: postgres
POSTGRES_PASSWORD: precontentieux
POSTGRES_PORT: 5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mailpit:
image: axllent/mailpit
ports:
- 1025:1025
- 8025:8025
steps:
- uses: actions/checkout@v4
- uses: browser-actions/setup-firefox@v1
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
- name: Cache yarn dependencies
uses: actions/cache@v3
with:
path: node_modules
key: yarn-${{ hashFiles('yarn.lock') }}
- name: Setup PHP and run tests
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: 'zip, intl, calendarn gd, pdo, pdo_pgsql, pgsql'
- name: Install yarn dependencies & build assets
run: |
sudo chown -R runner:runner .
composer install --no-interaction --optimize-autoloader
bin/console cache:clear
yarn install --no-progress --non-interactive
yarn build
- name: Run migration
run: bin/console doctrine:migrations:migrate --no-interaction --all-or-nothing
- name: Detect headless browser driver
run: vendor/bin/bdi detect drivers
- name: Running unit test
run: |
env | grep MAILPIT
bin/phpunit --log-junit test-result.xml
- name: Check test result file exists
id: check_test_result_file
uses: andstor/file-existence-action@v1
with:
files: test-result.xml
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ steps.check_test_result_file.outputs.files_exists == 'true' }}
with:
files: |
test-result.xml