forked from BookingSync/oauth2-bookingsync-php
-
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 #4 from benjaminmal/feature/add-github-ci
Add ci.yaml
- Loading branch information
Showing
3 changed files
with
105 additions
and
23 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,69 @@ | ||
name: Continuous integration | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 4 * * 1,2' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0] | ||
|
||
name: PHP ${{ matrix.php }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip | ||
coverage: pcov | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Install dependencies | ||
id: composer-update | ||
run: composer update --no-interaction --no-progress --prefer-dist | ||
|
||
- name: Fail the test | ||
if: steps.composer-update.outcome != 'success' | ||
run: exit 1 | ||
|
||
- name: Get PHPUnit version | ||
id: phpunit-version | ||
run: echo "::set-output name=version::$(composer info phpunit/phpunit | grep versions)" | ||
|
||
- name: Set pcov for PHPUnit 5.x, 6.x, 7.x | ||
if: contains(steps.phpunit-version.outputs.version, '* 5.') || contains(steps.phpunit-version.outputs.version, '* 6.') || contains(steps.phpunit-version.outputs.version, '* 7.') | ||
continue-on-error: true | ||
run: | | ||
composer require pcov/clobber --dev | ||
vendor/bin/pcov clobber | ||
- name: PHPUnit tests | ||
run: vendor/bin/phpunit --verbose --coverage-clover ./coverage.xml | ||
|
||
- name: Coverage | ||
uses: johanvanhelden/gha-clover-test-coverage-check@v1 | ||
with: | ||
percentage: "100" | ||
filename: "coverage.xml" | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.symfony/cache | ||
key: ${{ runner.os }}-php-${{ matrix.php }} | ||
restore-keys: ${{ runner.os }}-php- | ||
|
||
- name: The PHP Security Checker | ||
uses: symfonycorp/security-checker-action@v2 |
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