Skip to content

Commit 0b8822c

Browse files
committed
Fix GitHub Actions failure
1 parent a1ffbe0 commit 0b8822c

File tree

3 files changed

+214
-21
lines changed

3 files changed

+214
-21
lines changed

.github/workflows/php.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,50 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master, develop ]
5+
branches: [ develop ]
66
pull_request:
7-
branches: [ master, develop ]
7+
branches: [ develop ]
88

99
jobs:
1010
build:
1111

1212
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-version:
17+
- "7.2"
18+
- "7.3"
19+
- "7.4"
20+
dependencies:
21+
- "lowest"
22+
- "highest"
23+
name: Tests with PHP ${{ matrix.php-version }} and ${{ matrix.dependencies }} dependencies
1324

1425
steps:
1526
- uses: actions/checkout@v2
1627

17-
- name: Update PHP
18-
run: sudo update-alternatives --set php /usr/bin/php7.4
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
env:
33+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1934

2035
- name: Validate composer
2136
run: composer validate
2237

23-
- name: Cache Composer packages
24-
id: composer-cache
25-
uses: actions/cache@v2
38+
- name: Composer install
39+
uses: "ramsey/composer-install@v1"
2640
with:
27-
path: vendor
28-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29-
restore-keys: |
30-
${{ runner.os }}-php-
31-
32-
- name: Install dependencies
33-
if: steps.composer-cache.outputs.cache-hit != 'true'
34-
run: composer install --prefer-source --no-interaction
41+
dependency-versions: "${{ matrix.dependencies }}"
42+
composer-options: "${{ matrix.composer-options }}"
3543

3644
- name: Run unit tests suite
37-
run: php vendor/bin/phpunit --configuration tests/Unit/phpunit.xml.dist
45+
run: vendor/bin/phpunit --configuration tests/Unit/phpunit.xml.dist
3846

3947
- name: Run code style suite
40-
run: php vendor/bin/phpcs --standard=psr12 src/ --ignore=*.min.css
48+
run: vendor/bin/phpcs --standard=psr12 src/ --ignore=*.min.css
4149

4250
- name: Run tests code style
43-
run: php vendor/bin/phpcs --standard=psr12 tests/ --ignore=/_files/ -n
51+
run: vendor/bin/phpcs --standard=psr12 tests/ --ignore=/_files/ -n

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"require-dev": {
2222
"phpunit/phpunit": "^6.5.0",
2323
"ext-dom": "*",
24-
"squizlabs/php_codesniffer": "^3.5"
24+
"squizlabs/php_codesniffer": "^3.5.1"
2525
},
2626
"autoload": {
2727
"psr-4": {

0 commit comments

Comments
 (0)