-
Notifications
You must be signed in to change notification settings - Fork 486
109 lines (89 loc) · 3.92 KB
/
phpunit.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
name: PHPUnit 🐛
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
run: |
sudo apt-get update
sudo apt-get install nodejs npm
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, dom, gd, json, soap, zip, bcmath
ini-values: post_max_size=256M, max_execution_time=600, memory_limit=4096M, date.timezone=Europe/Paris
coverage: pcov
- name: Start mysql service
run: |
sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
# - name: Cache composer dependencies
# uses: actions/cache@v2
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies with composer
run: composer install --no-progress
- name: Install assets
run: php bin/console assets:install
- name: Install Yarn
run: |
sudo corepack enable
yarn set version stable
yarn --version
- name: Get yarn cache directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# - name: Cache yarn dependencies
# uses: actions/cache@v2
# id: yarn-cache
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: ${{ runner.os }}-yarn-
- name: Install JS dependencies
run: |
yarn install
yarn run encore production
- name: Check PHP settings
run: |
php -ini
php -v
php -m
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Setup test database
run: |
php bin/console --env=test cache:clear
php bin/console --env=test doctrine:database:create
php bin/console --env=test doctrine:schema:create
php bin/console --env=test doctrine:fixtures:load --no-interaction
- name: Run PHPUnit tests
run: php bin/phpunit --testdox --coverage-clover clover.xml
- name: Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./clover.xml
name: codecov-umbrella # optional
fail_ci_if_error: false
verbose: true