-
Notifications
You must be signed in to change notification settings - Fork 0
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 #22 from tflori/github-actions
use github actions for CI and add compatibility to php 8
- Loading branch information
Showing
16 changed files
with
139 additions
and
287 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,30 @@ | ||
version: "2" | ||
|
||
checks: | ||
method-complexity: | ||
config: | ||
threshold: 9 | ||
|
||
exclude_patterns: | ||
- "config/" | ||
- "db/" | ||
- "dist/" | ||
- "docs/" | ||
- "features/" | ||
- "**/node_modules/" | ||
- "script/" | ||
- "**/spec/" | ||
- "**/test/" | ||
- "**/tests/" | ||
- "Tests/" | ||
- "example.php" | ||
- "examples/" | ||
- "**/vendor/" | ||
- "**/*_test.go" | ||
- "**/*.d.ts" | ||
|
||
plugins: | ||
phpcodesniffer: | ||
enabled: true | ||
config: | ||
standard: "PSR2" |
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,81 @@ | ||
on: [push, pull_request] | ||
jobs: | ||
before: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prepare CodeClimate | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
run: | | ||
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 -qO ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
./cc-test-reporter before-build | ||
unit-tests: | ||
needs: [before] | ||
strategy: | ||
matrix: | ||
include: | ||
- image: 'iras/php7-composer:1' | ||
php_version: 7.1 | ||
- image: 'iras/php7-composer:2' | ||
php_version: 7.2 | ||
- image: 'iras/php7-composer:3' | ||
php_version: 7.3 | ||
- image: 'iras/php7-composer:4' | ||
php_version: 7.4 | ||
- image: 'iras/php8-composer:0' | ||
php_version: 8.0 | ||
name: PHP Unit Tests on PHP ${{ matrix.php_version }} | ||
runs-on: ubuntu-latest | ||
container: ${{ matrix.image }} | ||
steps: | ||
- name: Container Setup | ||
run: | | ||
apk add --no-cache tar openssl | ||
mkdir coverage | ||
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 -qO /usr/bin/cc-test-reporter | ||
chmod +x /usr/bin/cc-test-reporter | ||
- name: Checkout | ||
run: | | ||
git init && git remote add origin https://github.com/${{ github.repository }}.git | ||
git fetch origin ${{ github.sha }} && git reset --hard ${{ github.sha }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: /composer/cache | ||
key: composer-cache-7.${{ matrix.MINOR_VERSION }} | ||
- name: Install dependencies | ||
run: composer install --no-interaction --ansi | ||
- name: Execute tests | ||
run: | | ||
php -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit \ | ||
-c phpunit.xml \ | ||
--coverage-clover=coverage/clover.xml \ | ||
--coverage-text \ | ||
--color=always | ||
- name: Format Coverage | ||
run: | | ||
cc-test-reporter format-coverage -t clover -o coverage/cc-${{ matrix.php_version }}.json coverage/clover.xml | ||
- name: Store Coverage Result | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-results | ||
path: coverage/ | ||
|
||
after: | ||
needs: [unit-tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Restore Coverage Result | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: coverage-results | ||
path: coverage/ | ||
- name: Report Coverage | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
run: | | ||
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 -qO ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
./cc-test-reporter sum-coverage coverage/cc-*.json -p 5 -o coverage/cc-total.json | ||
./cc-test-reporter upload-coverage -i coverage/cc-total.json |
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 |
---|---|---|
|
@@ -6,5 +6,8 @@ composer.phar | |
# ide settings | ||
/.idea* | ||
|
||
# phpunit result | ||
/.phpunit.result.cache | ||
|
||
# rendered documentation | ||
/docs/_site |
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
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
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
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
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.