File tree Expand file tree Collapse file tree 4 files changed +70
-57
lines changed Expand file tree Collapse file tree 4 files changed +70
-57
lines changed Original file line number Diff line number Diff line change 1
- name : Lint
1
+ name : Coding standards
2
2
on : [push]
3
3
jobs :
4
4
lint :
5
- name : PHP Lint
5
+ name : Coding standards
6
6
runs-on : ubuntu-latest
7
+ strategy :
8
+ fail-fast : false
9
+ matrix :
10
+ php : [ '8.2', '8.3' ]
11
+
7
12
steps :
13
+ - name : Checkout
14
+ uses : actions/checkout@v2
15
+
8
16
- name : Setup PHP
9
17
uses : shivammathur/setup-php@v2
10
18
with :
11
- php-version : 8.2
19
+ php-version : ${{ matrix.php }}
20
+ tools : composer:v2
21
+
22
+ - name : Setup cache
23
+ run : echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
12
24
13
- - name : Cache Composer dependencies
25
+ - name : Cache dependencies installed with composer
14
26
uses : actions/cache@v2
15
27
with :
16
- path : /tmp/composer-cache
17
- key : ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
28
+ path : ${{ env.COMPOSER_CACHE_DIR }}
29
+ key : php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
30
+ restore-keys : |
31
+ php${{ matrix.php }}-composer-latest-
32
+
33
+ - name : Update composer
34
+ run : composer self-update
35
+
36
+ - name : Install dependencies with composer
37
+ run : composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
18
38
19
- - uses : actions/checkout@master
20
- - name : lint
21
- run : make lint
39
+ - name : Run code quality analysis
40
+ run : make lint
Original file line number Diff line number Diff line change 1
- name : Test
1
+ name : Tests
2
2
on : [push]
3
3
jobs :
4
- lint :
5
- name : PHP Test
6
- runs-on : ubuntu-latest
7
- steps :
8
- - name : Setup PHP
9
- uses : shivammathur/setup-php@v2
10
- with :
11
- php-version : 8.2
4
+ test :
5
+ name : Tests
6
+ runs-on : ubuntu-latest
7
+ strategy :
8
+ fail-fast : false
9
+ matrix :
10
+ php : [ '8.2', '8.3' ]
12
11
13
- - name : Cache Composer dependencies
14
- uses : actions/cache@v2
15
- with :
16
- path : /tmp/composer-cache
17
- key : ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
12
+ steps :
13
+ - name : Checkout
14
+ uses : actions/checkout@v2
18
15
19
- - uses : actions/checkout@master
20
- - name : test
21
- run : make test
16
+ - name : Setup PHP
17
+ uses : shivammathur/setup-php@v2
18
+ with :
19
+ php-version : ${{ matrix.php }}
20
+ tools : composer:v2
21
+
22
+ - name : Setup cache
23
+ run : echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
24
+
25
+ - name : Cache dependencies installed with composer
26
+ uses : actions/cache@v2
27
+ with :
28
+ path : ${{ env.COMPOSER_CACHE_DIR }}
29
+ key : php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
30
+ restore-keys : |
31
+ php${{ matrix.php }}-composer-latest-
32
+
33
+ - name : Update composer
34
+ run : composer self-update
35
+
36
+ - name : Install dependencies with composer
37
+ run : composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
38
+
39
+ - name : Run tests
40
+ run : make test
Original file line number Diff line number Diff line change 1
1
.DEFAULT_GOAL := help
2
2
3
- # -----------------------------------
4
- # Variables
5
- # -----------------------------------
6
- is_docker := $(shell docker info > /dev/null 2>&1 && echo 1)
7
- user := $(shell id -u)
8
- group := $(shell id -g)
9
-
10
- ifeq ($(is_docker ) , 1)
11
- php := USER_ID=$(user) GROUP_ID=$(group) docker-compose run --rm --no-deps php
12
- composer := $(php) composer
13
- else
14
- php := php
15
- composer := composer
16
- endif
17
-
18
3
# -----------------------------------
19
4
# Recipes
20
5
# -----------------------------------
@@ -24,17 +9,17 @@ help: ## affiche cet aide
24
9
25
10
.PHONY : lint
26
11
lint : vendor/autoload.php # # affiche les erreurs de formatage de code
27
- $( php ) vendor/bin/ecs
28
- $( php ) vendor/bin/phpstan
12
+ php vendor/bin/ecs
13
+ php vendor/bin/phpstan
29
14
30
15
.PHONY : test
31
16
test : vendor/autoload.php # # lance les tests
32
- $( php ) vendor/bin/phpunit
17
+ php vendor/bin/phpunit
33
18
34
19
.PHONY : lint-fix
35
20
lint-fix : vendor/autoload.php # # corrige les erreurs de formatage de code
36
- $( php ) vendor/bin/ecs --fix
21
+ php vendor/bin/ecs --fix
37
22
38
23
vendor/autoload.php : composer.lock # installe les dépendances PHP
39
- $( composer ) update
40
- $( composer ) dump-autoload
24
+ composer update
25
+ composer dump-autoload
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments