-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (63 loc) · 2.12 KB
/
php-test-coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
###
#
# 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/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
RUN_CODE_COVERAGE: "1"
with:
coverageCommand: composer run tests -- --coverage-clover clover.xml