-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added github actions to run phpunit tests (#378)
The ci.yml is configured to run the phpunit tests on any push to the repository. This will run the tests for a matrix of PHP versions to ensure all major versions supported are properly tests. In addition, if the tests all pass, code coverage for the tests will be generated and uploaded as an artifact of the run so they can be downloaded and examined. To support this I needed to specify which directories to be included in the code coverage in the phpunit.xml file.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 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,41 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
- 8.2 | ||
- 8.3 | ||
- nightly | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: php-actions/composer@v6 | ||
|
||
- name: PHPUnit Tests | ||
uses: php-actions/phpunit@master | ||
env: | ||
XDEBUG_MODE: coverage | ||
with: | ||
php_extensions: "xdebug" | ||
coverage_html: "coverage/html/" | ||
version: 9.5 | ||
bootstrap: tests/bootstrap.php | ||
configuration: phpunit.xml | ||
|
||
- name: Archive code coverage results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: code-coverage-report | ||
path: coverage/html |
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