Skip to content

Commit

Permalink
Merge pull request #3117 from l0gicgate/add-workflow-3x
Browse files Browse the repository at this point in the history
Add tests workflow to 3.x branch
  • Loading branch information
l0gicgate committed Oct 2, 2021
2 parents 5850aae + 997b49f commit 13f305f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tests

on: [push, pull_request]

jobs:
tests:
name: Tests PHP ${{ matrix.php }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: [7.3, 7.4, 8.0]
experimental: [false]
include:
- php: 8.0
analysis: true
- php: 8.1
experimental: true

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Install dependencies with Composer
uses: ramsey/composer-install@v1

- name: Coding standards
if: matrix.analysis
run: vendor/bin/phpcs

- name: Static analysis
if: matrix.analysis
run: vendor/bin/phpstan

- name: Tests
run: vendor/bin/phpunit --coverage-clover clover.xml

- name: Upload coverage results to Coveralls
if: matrix.analysis
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer require php-coveralls/php-coveralls -n -W
vendor/bin/php-coveralls --coverage_clover=clover.xml -v
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"psr/container": "^1.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.5",
"squizlabs/php_codesniffer": "^3.6.0",
"phpunit/phpunit": "^4.0"
},
"provide": {
Expand Down

0 comments on commit 13f305f

Please sign in to comment.