1
- name : Tests
1
+ name : CI — PHP Lint & Tests
2
2
3
- on : ['pull_request']
3
+ on :
4
+ pull_request :
5
+ branches : [ main ]
6
+ push :
7
+ branches : [ main ]
4
8
5
9
jobs :
6
10
ci :
7
- runs-on : ${{ matrix.os }}
8
- strategy :
9
- fail-fast : true
10
- matrix :
11
- os : [ubuntu-latest]
12
- php : [8.2]
13
- dependency-version : [prefer-lowest, prefer-stable]
14
-
15
- name : Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
11
+ runs-on : ubuntu-latest
16
12
17
13
steps :
14
+ - uses : actions/checkout@v3
18
15
19
- - name : Checkout
20
- uses : actions/checkout@v4
21
-
22
- - name : Cache dependencies
23
- uses : actions/cache@v4
24
- with :
25
- path : ~/.composer/cache/files
26
- key : dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
27
-
28
- - name : Setup PHP
29
- uses : shivammathur/setup-php@v2
30
- with :
31
- php-version : ${{ matrix.php }}
32
- extensions : dom, mbstring, zip
33
- coverage : none
16
+ - name : Setup PHP
17
+ uses : shivammathur/setup-php@v2
18
+ with :
19
+ php-version : ' 8.2'
20
+ extensions : mbstring, pdo_mysql # add the extensions you need
34
21
35
- - name : Install Composer dependencies
36
- run : composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist
22
+ - name : Validate composer.json
23
+ working-directory : app/src
24
+ run : composer validate --strict
37
25
38
- - name : Unit Tests
39
- run : composer test:unit
26
+ - name : Install dependencies
27
+ working-directory : app/src
28
+ run : composer install --no-progress --prefer-dist
40
29
41
- - name : Composer Audit
42
- run : composer audit
30
+ - name : Run tests (PHPUnit)
31
+ working-directory : app/src
32
+ run : composer test
0 commit comments