-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use github actions for PHPUnit (#170)
* Use github actions * Use constant PHP_EOL * minor * Push on master * Push on master * Fixed branch alias
- Loading branch information
Showing
8 changed files
with
107 additions
and
69 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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
on: [push, pull_request] | ||
on: | ||
pull_request: ~ | ||
push: | ||
branches: | ||
- "master" | ||
|
||
name: Roave | ||
jobs: | ||
roave_bc_check: | ||
|
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 |
---|---|---|
|
@@ -53,23 +53,14 @@ jobs: | |
composer config extra.branch-alias.dev-main ${{ steps.find_alias.outputs.alias }}-dev | ||
- name: Commit & push the new files | ||
run: | | ||
echo "::group::git status" | ||
git status | ||
echo "::endgroup::" | ||
git add -N . | ||
if [[ $(git diff --numstat | wc -l) -eq 0 ]]; then | ||
echo "No changes found. Exiting." | ||
exit 0; | ||
fi | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub" | ||
echo "::group::git push" | ||
git add . | ||
git commit -m "Update branch alias" | ||
git push | ||
echo "::endgroup::" | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
base: main | ||
branch: branch-alias-update | ||
author: GitHub <[email protected]> | ||
committer: GitHub <[email protected]> | ||
commit-message: Updating branch alias to ${{ steps.find_alias.outputs.alias }} | ||
title: Update branch alias | ||
body: | | ||
Since we just tagged a new version, we need to update composer.json branch alias. |
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,4 +1,9 @@ | ||
on: [push, pull_request] | ||
on: | ||
pull_request: ~ | ||
push: | ||
branches: | ||
- "master" | ||
|
||
name: Static analysis | ||
jobs: | ||
phpstan: | ||
|
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,82 @@ | ||
on: | ||
pull_request: ~ | ||
push: | ||
branches: | ||
- "master" | ||
|
||
name: Tests | ||
|
||
jobs: | ||
phpunit: | ||
name: PHPUnit with PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }} | ||
|
||
strategy: | ||
matrix: | ||
operating-system: | ||
- 'ubuntu-latest' | ||
php-version: | ||
- '7.1' | ||
- '7.2' | ||
- '7.3' | ||
- '7.4' | ||
- '8.0' | ||
include: | ||
- operating-system: 'windows-latest' | ||
php-version: '7.4' | ||
|
||
runs-on: ${{ matrix.operating-system }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP with extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: none | ||
php-version: ${{ matrix.php-version }} | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }} | ||
restore-keys: | | ||
composer-${{ runner.os }}-${{ matrix.php-version }}- | ||
composer-${{ runner.os }}- | ||
composer- | ||
- name: Download dependencies | ||
run: composer update --no-interaction --no-progress --optimize-autoloader | ||
|
||
- name: Run PHPUnit | ||
run: ./vendor/bin/phpunit | ||
|
||
phpunit-lowest: | ||
name: PHPUnit lowest dependencies | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP with extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: none | ||
php-version: 7.4 | ||
|
||
- name: Download dependencies | ||
run: composer update --no-interaction --no-progress --optimize-autoloader --prefer-stable --prefer-lowest | ||
|
||
- name: Run PHPUnit | ||
run: ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml | ||
|
||
- name: Upload coverage | ||
run: | | ||
wget https://scrutinizer-ci.com/ocular.phar | ||
php ocular.phar code-coverage:upload --format=php-clover coverage.xml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ | |
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.0-dev" | ||
"dev-master": "1.4-dev" | ||
} | ||
} | ||
} |
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