Skip to content

Fix Github Actions failure #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,49 @@ name: CI

on:
push:
branches: [ master, develop ]
branches: [ develop ]
pull_request:
branches: [ master, develop ]
branches: [ develop ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- "7.3"
- "7.4"
dependencies:
- "lowest"
- "highest"
name: Tests with PHP ${{ matrix.php-version }} and ${{ matrix.dependencies }} dependencies

steps:
- uses: actions/checkout@v2

- name: Update PHP
run: sudo update-alternatives --set php /usr/bin/php7.4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate composer
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
- name: Composer install
uses: "ramsey/composer-install@v1"
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-source --no-interaction
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"

- name: Run unit tests suite
run: php vendor/bin/phpunit --configuration tests/Unit/phpunit.xml.dist
run: vendor/bin/phpunit --configuration tests/Unit/phpunit.xml.dist

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

- name: Run tests code style
run: php vendor/bin/phpcs --standard=psr12 tests/ --ignore=/_files/ -n
run: vendor/bin/phpcs --standard=psr12 tests/ --ignore=/_files/ -n
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"bin": ["bin/svc"],
"require": {
"php": "~7.2.29||~7.3.0||~7.4.0",
"php": "~7.3.0||~7.4.0",
"ext-json": "*",
"phpstan/phpdoc-parser": "^0.3.5",
"symfony/console": "~4.1.0||~4.4.0",
Expand All @@ -21,7 +21,7 @@
"require-dev": {
"phpunit/phpunit": "^6.5.0",
"ext-dom": "*",
"squizlabs/php_codesniffer": "^3.5"
"squizlabs/php_codesniffer": "^3.5.1"
},
"autoload": {
"psr-4": {
Expand Down
Loading