-
-
Notifications
You must be signed in to change notification settings - Fork 29
135 lines (122 loc) · 4.14 KB
/
integration-testing.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Integration Testing
on:
push:
branches:
- develop
- main
pull_request_target:
branches:
- develop
- main
paths:
- "**.php"
- ".github/workflows/*.yml"
- "!docs/**"
types: [ opened, synchronize, reopened, labeled ]
jobs:
continuous_integration:
runs-on: ubuntu-latest
name: WordPress ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
if: contains(github.event.pull_request.labels.*.name, 'safe to test ✔') || github.repository == github.event.repository.full_name || github.event_name == 'push'
strategy:
matrix:
php: [ '8.1', '8.0', '7.4' ]
wordpress: [ '6.3', '6.2', '6.1', '6.0', '5.9' ]
include:
- php: '8.1'
wordpress: '6.3'
coverage: 1
# Older versions of WordPress
- php: '8.0'
wordpress: '5.8'
- php: '8.0'
wordpress: '5.7'
- php: '7.4'
wordpress: '5.8'
- php: '7.4'
wordpress: '5.7'
exclude:
- php: '7.4'
wordpress: '6.3'
- php: '7.4'
wordpress: '6.2'
fail-fast: false
steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request_target' }}
uses: styfle/cancel-workflow-action@0.11.0
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring
tools: composer:v2
- name: Install dependencies
uses: ramsey/composer-install@v2
- name: Build "testing" Docker Image
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
GF_KEY: ${{ secrets.GF_KEY }}
run: |
cp .env.dist .env
echo GF_KEY=${{ secrets.GF_KEY }} >> .env
composer build-test
- name: Run Acceptance Tests w/ Docker
env:
COVERAGE: ${{ matrix.coverage }}
USING_XDEBUG: ${{ matrix.coverage }}
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
SKIP_TESTS_CLEANUP: ${{ matrix.coverage }}
SUITES: acceptance
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
GF_KEY: ${{ secrets.GF_KEY }}
run: |
cp .env.dist .env
echo GF_KEY=${{ secrets.GF_KEY }} >> .env
composer run-test
- name: Run Unit Tests w/ Docker
env:
COVERAGE: ${{ matrix.coverage }}
USING_XDEBUG: ${{ matrix.coverage }}
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
SKIP_TESTS_CLEANUP: ${{ matrix.coverage }}
SUITES: unit
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
GF_KEY: ${{ secrets.GF_KEY }}
run: |
cp .env.dist .env
echo GF_KEY=${{ secrets.GF_KEY }} >> .env
composer run-test
- name: Run WPUnit Tests w/ Docker
env:
COVERAGE: ${{ matrix.coverage }}
USING_XDEBUG: ${{ matrix.coverage }}
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }}
SKIP_TESTS_CLEANUP: ${{ matrix.coverage }}
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
GF_KEY: ${{ secrets.GF_KEY }}
run: |
cp .env.dist .env
echo GF_KEY=${{ secrets.GF_KEY }} >> .env
composer run-test
- name: Push Codecoverage to Coveralls.io
if: ${{ matrix.coverage == 1 }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: vendor/bin/php-coveralls -v
- name: Push CodeCoverage to CodeClimate
if: ${{ matrix.coverage == 1 }}
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: c8f992fb9d2400821643b093de584af5a3c8d0a8f1f6f4e000592ccf0270ee29
with:
coverageLocations: |
${{github.workspace}}/tests/_output/*.xml:clover