-
-
Notifications
You must be signed in to change notification settings - Fork 2
179 lines (166 loc) · 6.72 KB
/
test.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Test
on: [push]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- wp_docker_tag: 5.2-php7.1-apache
xdebug_version: xdebug-2.7.2
php_version: 7.1
- wp_docker_tag: 5.3-php7.1-apache
xdebug_version: xdebug-2.7.2
php_version: 7.1
- wp_docker_tag: 5.4-php7.2-apache
xdebug_version: xdebug-2.7.2
php_version: 7.2
- wp_docker_tag: 5.5-php7.2-apache
xdebug_version: xdebug-2.7.2
php_version: 7.2
- wp_docker_tag: 5.6-php7.2-apache
xdebug_version: xdebug-2.7.2
php_version: 7.2
- wp_docker_tag: 5.7-php7.3-apache
xdebug_version: xdebug-2.7.2
php_version: 7.3
- wp_docker_tag: 5.8-php7.3-apache
xdebug_version: xdebug-2.7.2
php_version: 7.3
- wp_docker_tag: 5.8-php7.4-apache
xdebug_version: xdebug-3.0.4
php_version: 7.4
- wp_docker_tag: 5.8-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 5.9-php7.3-apache
xdebug_version: xdebug-2.7.2
php_version: 7.3
- wp_docker_tag: 5.9-php7.4-apache
xdebug_version: xdebug-3.0.4
php_version: 7.4
- wp_docker_tag: 5.9-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.0-php7.4-apache
xdebug_version: xdebug-3.0.4
php_version: 7.4
- wp_docker_tag: 6.0-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.1-php7.4-apache
xdebug_version: xdebug-3.0.4
php_version: '7.4'
- wp_docker_tag: 6.1-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.2-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.2-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.2-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.3-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.3-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.3-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.4-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.4-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.4-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.5-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.5-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.5-php8.3-apache
xdebug_version: xdebug-3.3.1
php_version: '8.3'
- wp_docker_tag: 6.6-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.6-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.6-php8.3-apache
xdebug_version: xdebug-3.3.1
php_version: '8.3'
fail-fast: false
env:
WP_DOCKER_TAG: ${{ matrix.wp_docker_tag }}
XDEBUG_VERSION: ${{ matrix.xdebug_version }}
PHP_VERSION: ${{ matrix.php_version }}
steps:
- uses: actions/checkout@v1
- name: Set Node Version
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: zip
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Install npm dependencies
run: npm install
- name: Build
run: npx webpack -p
- name: Setup docker
run: docker-compose up -d
- name: Create config file
run: touch .env.testing
- name: Check running containers
run: docker ps -a
- name: Run test suite
run: |
npx wait-on http://localhost/wp-login.php --verbose --timeout 60000 && docker exec -w /var/www/html disable-media-pages_wordpress.test_1 bash -c "sudo chown -R www-data:www-data /var/www/html && sudo chmod -R 775 /var/www/html && wp core install --url=wordpress --title=example --admin_user=admin [email protected]"
npx wait-on http://localhost/wp-login.php --verbose --timeout 60000 && docker exec -w /var/www/html/wp-content/plugins/disable-media-pages -e WP_ROOT_FOLDER -e TEST_SITE_WP_ADMIN_PATH -e TEST_SITE_DB_NAME -e TEST_SITE_DB_HOST -e TEST_SITE_DB_USER -e TEST_SITE_DB_PASSWORD -e TEST_SITE_DB_PASSWORD -e TEST_SITE_TABLE_PREFIX -e TEST_SITE_WP_URL -e TEST_SITE_WP_DOMAIN -e TEST_SITE_ADMIN_EMAIL -e TEST_SITE_ADMIN_USERNAME -e TEST_SITE_ADMIN_PASSWORD -e CHROMEDRIVER_HOST -e CHROMEDRIVER_PORT -e WP_VERSION -e C3_URL -e XDEBUG_MODE disable-media-pages_wordpress.test_1 bash -c './vendor/bin/codecept run acceptance --fail-fast --debug --coverage --coverage-xml'
env:
WP_ROOT_FOLDER: /var/www/html
TEST_SITE_WP_ADMIN_PATH: /wp-admin
TEST_SITE_DB_NAME: exampledb
TEST_SITE_DB_HOST: db
TEST_SITE_DB_USER: exampleuser
TEST_SITE_DB_PASSWORD: examplepass
TEST_SITE_TABLE_PREFIX: wp_
TEST_SITE_WP_URL: http://wordpress.test
TEST_SITE_WP_DOMAIN: wordpress
TEST_SITE_ADMIN_EMAIL: [email protected]
TEST_SITE_ADMIN_USERNAME: admin
TEST_SITE_ADMIN_PASSWORD: admin
CHROMEDRIVER_HOST: chromedriver
CHROMEDRIVER_PORT: 4444
XDEBUG_MODE: coverage
C3_URL: http://wordpress.test/wp-content/plugins/disable-media-pages/disable-media-pages.php?
WP_CLI_ALLOW_ROOT: true
- name: Upload artifact
if: failure()
uses: actions/[email protected]
with:
name: Test output ${{ matrix.wp_docker_tag }}
path: tests/_output/
- uses: codecov/codecov-action@v3
with:
files: ./tests/_output/coverage.xml
verbose: true
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2