Skip to content

Commit c198a91

Browse files
committed
ci: workflow for php8.2 and php8.3
1 parent 559065a commit c198a91

4 files changed

Lines changed: 43 additions & 63 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
1-
name: Lint
1+
name: Coding standards
22
on: [push, pull_request]
33
jobs:
4-
lint:
5-
name: PHP Lint
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+
lint:
5+
name: Coding standards
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
php: [ '8.2', '8.3' ]
1211

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
1815

19-
- uses: actions/checkout@master
20-
- name: lint
21-
run: make lint
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 code quality analysis
40+
run: make lint

.github/workflows/test.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

Makefile

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
.DEFAULT_GOAL := help
22

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-
php := php
19-
composer := composer
20-
213
# -----------------------------------
224
# Recipes
235
# -----------------------------------
@@ -27,17 +9,17 @@ help: ## affiche cet aide
279

2810
.PHONY: lint
2911
lint: vendor/autoload.php ## affiche les erreurs de formatage de code
30-
$(php) vendor/bin/ecs
31-
$(php) vendor/bin/phpstan
12+
php vendor/bin/ecs
13+
php vendor/bin/phpstan
3214

3315
.PHONY: test
3416
test: vendor/autoload.php ## lance les tests
35-
$(php) vendor/bin/phpunit
17+
php vendor/bin/phpunit
3618

3719
.PHONY: lint-fix
3820
lint-fix: vendor/autoload.php ## corrige les erreurs de formatage de code
39-
$(php) vendor/bin/ecs --fix
21+
php vendor/bin/ecs --fix
4022

4123
vendor/autoload.php: composer.lock # installe les dépendances PHP
42-
$(composer) update
43-
$(composer) dump-autoload
24+
composer update
25+
composer dump-autoload

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Flexpay PHP
22

33
![Lint](https://github.com/devscast/flexpay/actions/workflows/lint.yaml/badge.svg)
4-
![Test](https://github.com/devscast/flexpay/actions/workflows/test.yaml/badge.svg)
4+
![Test](https://github.com/devscast/flexpay/actions/workflows/lint.yaml/badge.svg)
55
[![Latest Stable Version](https://poser.pugx.org/devscast/flexpay/version)](https://packagist.org/packages/devscast/flexpay)
66
[![Total Downloads](https://poser.pugx.org/devscast/flexpay/downloads)](https://packagist.org/packages/devscast/flexpay)
77
[![License](https://poser.pugx.org/devscast/flexpay/license)](https://packagist.org/packages/devscast/flexpay)

0 commit comments

Comments
 (0)