[Test] Separate Weekly CI for code coverage generation (#5044)

This commit is contained in:
Abdul Malik Ikhsan 2020-12-30 05:48:07 +07:00 committed by GitHub
parent 6ddb4effd8
commit bf9e31b515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 18 deletions

View File

@ -0,0 +1,58 @@
name: Weekly Code Coverage
on:
schedule:
# https://crontab.guru/once-a-week
- cron: "0 0 * * 0"
jobs:
weekly_code_coverage:
strategy:
fail-fast: false
matrix:
actions:
-
name: "Re-Generate Code Coverage"
run: |
composer require --dev nimut/phpunit-merger
vendor/bin/phpunit --coverage-php build/logs/rules.cov rules
vendor/bin/phpunit --coverage-php build/logs/packages.cov packages
vendor/bin/phpunit --coverage-php build/logs/tests.cov tests
vendor/bin/phpunit --coverage-php build/logs/utils.cov utils
vendor/bin/phpunit-merger coverage build/logs clover.xml
# Coveralls.io
composer require --dev php-coveralls/php-coveralls:^2.4
vendor/bin/php-coveralls --coverage_clover=clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
branch: 'master'
name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
steps:
-
if: github.event.pull_request.head.repo.full_name == github.repository
uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
# see https://github.com/shivammathur/setup-php
-
if: github.event.pull_request.head.repo.full_name == github.repository
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: xdebug
tools: composer:v2
-
if: github.event.pull_request.head.repo.full_name == github.repository
run: composer install --no-progress --ansi
-
if: github.event.pull_request.head.repo.full_name == github.repository
run: ${{ matrix.actions.run }}

View File

@ -15,24 +15,6 @@ jobs:
name: "Re-Generate CHANGELOG.md"
run: "composer changelog"
branch: 'automated-regenerated-changelog'
-
name: "Re-Generate Code Coverage"
run: |
composer require --dev nimut/phpunit-merger
vendor/bin/phpunit --coverage-php build/logs/rules.cov rules
vendor/bin/phpunit --coverage-php build/logs/packages.cov packages
vendor/bin/phpunit --coverage-php build/logs/tests.cov tests
vendor/bin/phpunit --coverage-php build/logs/utils.cov utils
vendor/bin/phpunit-merger coverage build/logs clover.xml
# Coveralls.io
composer require --dev php-coveralls/php-coveralls:^2.4
vendor/bin/php-coveralls --coverage_clover=clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
branch: 'automated-regenerated-code-coverage'
name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest