-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62dbd78
commit adb8aea
Showing
3 changed files
with
59 additions
and
3 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,39 @@ | ||
name: Code coverage (`src` directory) | ||
|
||
on: | ||
pull_request | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
woocommerce-coverage: | ||
name: Src Coverage | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 10 | ||
matrix: | ||
woocommerce: [ 'latest' ] | ||
wordpress: [ 'latest' ] | ||
php: [ '7.4' ] | ||
env: | ||
WP_VERSION: ${{ matrix.wordpress }} | ||
WC_VERSION: ${{ matrix.woocommerce }} | ||
steps: | ||
# clone the repository | ||
- uses: actions/checkout@v3 | ||
# enable dependencies caching | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/composer/ | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | ||
# setup PHP, but without debug extensions for reasonable performance | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer | ||
coverage: xdebug2 | ||
# run CI checks | ||
- run: bash bin/run-ci-tests-check-src-coverage.bash |
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,16 @@ | ||
#!/bin/bash | ||
|
||
# set strict mode for bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# set environment variables | ||
WCPAY_DIR="$GITHUB_WORKSPACE" | ||
|
||
composer self-update && composer install --no-progress | ||
sudo systemctl start mysql.service | ||
bash bin/install-wp-tests.sh woocommerce_test root root localhost $WP_VERSION $WC_VERSION false | ||
echo 'Running the tests...' | ||
bash bin/phpunit.sh phpunit-src.xml.dist --coverage-clover /tmp/clover.xml | ||
vendor/bin/coverage-check /tmp/clover.xml 100 | ||
|