-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from markstory/update-ci
Update CI to github.
- Loading branch information
Showing
7 changed files
with
119 additions
and
58 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,98 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
testsuite-linux: | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.2', '7.4', '8.0'] | ||
prefer-lowest: [''] | ||
include: | ||
- php-version: '7.2' | ||
prefer-lowest: 'prefer-lowest' | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: mbstring, intl | ||
coverage: pcov | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Get date part for cache key | ||
id: key-date | ||
run: echo "::set-output name=date::$(date +'%Y-%m')" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }} | ||
|
||
- name: Composer install | ||
run: | | ||
if [[ ${{ matrix.php-version }} == '8.0' ]]; then | ||
composer install --ignore-platform-reqs | ||
elif ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then | ||
composer update --prefer-lowest --prefer-stable | ||
else | ||
composer install | ||
fi | ||
- name: Run PHPUnit | ||
run: | | ||
if [[ ${{ matrix.php-version }} == '7.4' ]]; then | ||
vendor/bin/phpunit --coverage-clover=coverage.xml | ||
else | ||
vendor/bin/phpunit | ||
fi | ||
- name: Code Coverage Report | ||
if: success() && matrix.php-version == '7.4' | ||
uses: codecov/codecov-action@v1 | ||
|
||
cs-stan: | ||
name: Coding Standard & Static Analysis | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
extensions: mbstring, intl | ||
coverage: none | ||
tools: psalm:~4.1.0, phpstan:^0.12 | ||
|
||
- name: Composer Install | ||
run: composer install | ||
|
||
- name: Run phpcs | ||
run: vendor/bin/phpcs -p src/ tests/ | ||
|
||
- name: Run psalm | ||
run: psalm --output-format=github | ||
|
||
- name: Run phpstan | ||
run: phpstan analyse |
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
parameters: | ||
level: 5 | ||
checkMissingIterableValueType: false | ||
autoload_files: | ||
bootstrapFiles: | ||
- tests/bootstrap.php | ||
ignoreErrors: | ||
paths: | ||
- src/ |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
bootstrap="tests/bootstrap.php" | ||
> | ||
<phpunit bootstrap="tests/bootstrap.php"> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<testsuites> | ||
<testsuite name="asset-compress"> | ||
<directory>tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<testsuites> | ||
<testsuite name="asset-compress"> | ||
<directory>tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
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