Repository navigation
180 lines (147 loc) · 5.08 KB
/
Copy pathtests.yml
File metadata and controls
180 lines (147 loc) · 5.08 KB
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
180
name: Tests
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
unit-tests:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
- name: Run unit tests
run: vendor/bin/phpunit --testsuite Unit
wporg-standards:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
- name: Run WordPress.org required-standards check
run: composer phpcs:wporg
- name: Run docblock standard check
run: composer phpcs:docblocks
frontend-typecheck:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: resources/app/package-lock.json
- name: Install npm dependencies
run: npm ci
working-directory: resources/app
- name: Run TypeScript typecheck
run: npm run typecheck
working-directory: resources/app
integration-tests:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
name: integration-tests (${{ matrix.database.name }})
strategy:
fail-fast: false
matrix:
# MySQL 5.7 is the supported floor and is stricter than MariaDB in ways
# that matter: ONLY_FULL_GROUP_BY is on by default there and off here,
# and the MySQL 8 regex functions are unavailable. Running only MariaDB
# would let both classes of breakage reach a release.
database:
- name: MariaDB 10.6
image: mariadb:10.6
health-cmd: healthcheck.sh --connect --innodb_initialized
- name: MySQL 5.7
image: mysql:5.7
# Credentialed and over TCP on purpose: a bare `mysqladmin ping`
# answers "mysqld is alive" from the init-time server ~4s before
# authenticated TCP connections start working, which would let the
# job start against a database it cannot yet log into.
health-cmd: mysqladmin ping -h 127.0.0.1 -uroot -proot --silent
services:
database:
image: ${{ matrix.database.image }}
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: kirki_ecommerce_test
ports:
- 3306:3306
options: >-
--health-cmd="${{ matrix.database.health-cmd }}"
--health-interval=5s
--health-timeout=5s
--health-retries=10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mysqli, intl, zip, gd, dom, exif
coverage: none
tools: composer
- name: Install Subversion
run: sudo apt-get update && sudo apt-get install -y subversion
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
- name: Install WordPress test suite
run: bash bin/install-wp-tests.sh kirki_ecommerce_test root root 127.0.0.1:3306 latest yes
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_CORE_DIR: /tmp/wordpress
- name: Run integration tests
run: vendor/bin/phpunit --testsuite Integration
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_CORE_DIR: /tmp/wordpress
DB_NAME: kirki_ecommerce_test
DB_USER: root
DB_PASSWORD: root
DB_HOST: 127.0.0.1:3306
storefront-tests:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: resources/site/package-lock.json
- name: Install npm dependencies
run: npm ci
working-directory: resources/site
- name: Run TypeScript typecheck
run: npm run typecheck
working-directory: resources/site
- name: Run storefront tests
run: npm test
working-directory: resources/site