Skip to content

Release Version 2.5.2 #892

Release Version 2.5.2

Release Version 2.5.2 #892

###
#
# This workflow file is deployed into this repository via the "Sync Organization Files" workflow
#
# Direct edits to this file are at risk of being overwritten by the next sync. All edits should be made
# to the source file.
#
# @see Sync workflow {@link https://github.com/gocodebox/.github/actions/workflows/workflow-sync.yml}
# @see Workflow template {@link https://github.com/gocodebox/.github/blob/trunk/.github/workflow-templates/php-test-coverage.yml}
#
###
name: PHP Code Coverage Report
on:
workflow_dispatch:
inputs:
cache-suffix:
description: Cache suffix
type: string
pull_request:
# Once daily at 00:00 UTC.
# schedule:
# - cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ 'pull_request' == github.event_name && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
check-secret:
name: "Check for required secret"
runs-on: ubuntu-latest
outputs:
has-secret: ${{ steps.check-secret.outputs.has-secret }}
steps:
- name: Test secret
id: check-secret
run: |
if [ ! -z "${{ secrets.CC_TEST_REPORTER_ID }}" ]; then
echo "::set-output name=has-secret::true"
fi
test:
name: "PHP Test Coverage"
runs-on: ubuntu-latest
needs: check-secret
if: ${{ 'true' == needs.check-secret.outputs.has-secret }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Environment
uses: gocodebox/.github/.github/actions/setup-phpunit@trunk
with:
php-version: "8.0"
wp-version: "5.8"
coverage: "xdebug"
env-file: ".github/.env.php-test-coverage"
deploy-key: ${{ secrets.LLMS_DEPLOY_KEY }}
secrets: ${{ toJSON( secrets ) }}
cache-suffix: ${{ inputs.cache-suffix }}
- name: Run Tests with Coverage & Upload Coverage Report
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
RUN_CODE_COVERAGE: "1"
with:
coverageCommand: composer run tests -- --coverage-clover clover.xml