-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rotimi
authored and
rotimi
committed
Apr 14, 2021
1 parent
9eb947d
commit d799749
Showing
6 changed files
with
253 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Run PHP Tests and Code Quality Tools | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
schedule: | ||
# Also run every Sunday at midnight | ||
- cron: '0 0 * * 0' | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
php: [8.0, 7.4, 7.3, 7.2] | ||
# prefer-lowest is causing unit tests to fail when php 7.2 is run against PHPunit 7.x, | ||
# PHPUnit 8.x is the latest stable release that supports PHP 7.2 and that runs fine | ||
# dependency-version: [prefer-lowest, prefer-stable] | ||
dependency-version: [prefer-stable] | ||
os: [ubuntu-18.04, ubuntu-20.04] | ||
include: | ||
- os: ubuntu-18.04 | ||
php: 7.2 | ||
- os: ubuntu-18.04 | ||
php: 7.3 | ||
- os: ubuntu-18.04 | ||
php: 7.4 | ||
- os: ubuntu-18.04 | ||
php: 8.0 | ||
- os: ubuntu-20.04 | ||
php: 7.4 | ||
- os: ubuntu-20.04 | ||
php: 8.0 | ||
exclude: | ||
- os: ubuntu-20.04 | ||
php: 7.3 | ||
|
||
name: PHP-${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
ini-values: pcre.jit=0, pcre.backtrack_limit=9999999, pcre.recursion_limit=9999999 | ||
coverage: none | ||
|
||
- name: PHP version | ||
run: php -v | ||
|
||
- name: Composer version | ||
run: composer --version | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Install Dependencies | ||
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress | ||
|
||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | ||
# Docs: https://getcomposer.org/doc/articles/scripts.md | ||
- name: Run PHPUnit Test Suite | ||
run: vendor/bin/phpunit | ||
|
||
- name: Run Rector | ||
# Run rector for PHP 7.X but not 8.0, rector is currently blowing up with PHP 8.0 | ||
#if: matrix.php != '8.0' | ||
run: vendor/bin/rector process src --dry-run | ||
|
||
- name: Run Psalm | ||
# Run psalm for PHP 7.4 & 8.0 but not 7.2 & 7.3, psalm is currently blowing up with PHP 7.2 & 7.3 | ||
#if: matrix.php != '7.2' && matrix.php != '7.3' | ||
run: vendor/bin/psalm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="3" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src" /> | ||
<ignoreFiles> | ||
<directory name="vendor" /> | ||
</ignoreFiles> | ||
</projectFiles> | ||
</psalm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.