-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Codecov action and run tests in own workflow
1 parent
da4463b
commit 4a61961
Showing
2 changed files
with
64 additions
and
38 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
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,45 @@ | ||
on: [ push, pull_request ] | ||
name: Codecov | ||
|
||
jobs: | ||
codeception-tests: | ||
name: "Codeception tests" | ||
runs-on: "ubuntu-20.04" | ||
continue-on-error: ${{ matrix.allow-fail }} | ||
strategy: | ||
matrix: | ||
include: | ||
# - { php-version: 7.4, dependencies: locked, coverage: none, with_coverage: false, allow-fail: false } | ||
# - { php-version: 7.4, dependencies: highest, coverage: none, with_coverage: false, allow-fail: true } | ||
# - { php-version: 8.0, dependencies: locked, coverage: none, with_coverage: false, allow-fail: false } | ||
# - { php-version: 8.0, dependencies: highest, coverage: none, with_coverage: false, allow-fail: true } | ||
- { php-version: 8.0, dependencies: locked, coverage: xdebug, with_coverage: true, allow-fail: false } | ||
# - { php-version: 8.1, dependencies: highest, coverage: none, with_coverage: false, allow-fail: true } | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "${{ matrix.coverage }}" | ||
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767 | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Install dependencies with Composer" | ||
uses: "ramsey/composer-install@v1" | ||
with: | ||
dependency-versions: "${{ matrix.dependencies }}" | ||
|
||
- name: "Run Codeception with coverage" | ||
run: | | ||
vendor/bin/codecept run -c . -vvv --json --coverage --coverage-xml=coverage.xml | ||
- name: Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | ||
files: ./build/logs/coverage.xml | ||
flags: unittests # optional | ||
fail_ci_if_error: "${{ matrix.with_coverage }}" # optional (default = false) | ||
verbose: true # optional (default = false) |