Skip to content

Commit

Permalink
CI - new workflow for GitHub actions (#82)
Browse files Browse the repository at this point in the history
* php>=7.2

* CI workflow - added php matrix
  • Loading branch information
msztorc authored Jan 6, 2021
1 parent a4b0fac commit 2f043ba
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
46 changes: 33 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
name: Tests

on: [push]
on: [push, pull_request]

jobs:
build-test:
runs-on: ubuntu-latest
php-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [8.0, 7.4, 7.3, 7.2]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest, windows-latest]

name: ${{ matrix.os }} - PHP${{ matrix.php }} - ${{ matrix.dependency-version }}

steps:
- uses: actions/checkout@v1
- uses: php-actions/composer@v1
- name: PHPUnit
uses: php-actions/phpunit@v1
with:
config: ./phpunit.xml.dist
- name: PHP CS Fixer
uses: StephaneBour/[email protected]
with:
dir: './src'
- name: Checkout code
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, bcmath, intl
coverage: none

- name: Install dependencies
run: |
composer install --no-interaction
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit

- name: PHP CS Fixer
uses: StephaneBour/[email protected]
if: matrix.os != 'windows-latest'
with:
dir: './src'
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"require-dev": {
"phpunit/phpunit": ">=8.0"
Expand Down

0 comments on commit 2f043ba

Please sign in to comment.