-
-
Notifications
You must be signed in to change notification settings - Fork 130
81 lines (73 loc) · 2.6 KB
/
continous-integration.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
name: Automated-Testing
on:
schedule:
- cron: '0 4 * * 5'
push:
branches:
- develop
- master
pull_request:
branches:
- develop
paths:
- '**.php'
- '!docs/**'
jobs:
Automated-Testing:
env:
STRIPE_API_PUBLISHABLE_KEY: ${{ secrets.STRIPE_API_PUBLISHABLE_KEY }}
STRIPE_API_SECRET_KEY: ${{ secrets.STRIPE_API_SECRET_KEY }}
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.0', '7.4']
wordpress: ['6.3', '6.2', '6.1', '6.0']
composer_version: ['v2']
include:
- php: '7.4'
wordpress: '6.2'
coverage: '--coverage --coverage-xml'
xdebug: 1
- php: '8.1'
wordpress: '6.1'
debug: '--debug'
- wordpress: '6.2'
hpos: 1
fail-fast: false
name: Running Automated Tests w/ WPBrowser in WordPress v${{ matrix.wordpress }} on PHP${{ matrix.php }} ${{ matrix.hpos == 1 && 'with HPOS activated ' || '' }}${{ matrix.coverage == '--coverage --coverage-xml' && 'with Codecoverage ' || '' }}${{ matrix.debug == '--debug' && 'in Debug Mode ' || '' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring
tools: composer
- name: Install dependencies
run: |
cp .env.testing .env
rm -rf composer.lock
composer install
WP_VERSION=${{ matrix.wordpress }} SKIP_DB_CREATE=true SKIP_WP_SETUP=true composer installTestEnv
- name: Run Tests.
env:
USING_XDEBUG: ${{ matrix.xdebug }}
WP_VERSION: ${{ matrix.wordpress }}
PHP_VERSION: ${{ matrix.php }}
run: HPOS="${{ matrix.hpos }}" FILTER="${{ matrix.coverage }} ${{ matrix.debug }}" composer dRunTestStandalone
- name: Push Codecoverage to Coveralls.io
if: ${{ matrix.coverage == '--coverage --coverage-xml' && env.STRIPE_API_PUBLISHABLE_KEY != null }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls -v
- name: Test & publish code coverage
if: ${{ matrix.coverage == '--coverage --coverage-xml' }}
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 739347fbfc0caa4e7f25069899203df2d4a411b3cbc9c3b1ef28257520c99d31
with:
coverageLocations: |
${{github.workspace}}/tests/_output/*.xml:clover