-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (60 loc) · 1.75 KB
/
tests.yml
File metadata and controls
75 lines (60 loc) · 1.75 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
name: Tests
on:
pull_request:
branches: [main]
workflow_call:
jobs:
lint:
name: WordPress Coding Standards
runs-on: ubuntu-latest
container:
image: codeccoop/wp-test
steps:
- uses: actions/checkout@v5
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer install
run: composer -q install
- name: Lint and format
run: vendor/bin/phpcbf
phpunit:
name: PHP Unit Testing
runs-on: ubuntu-latest
container:
image: codeccoop/wp-test
steps:
- name: Start MariaDB
run: nohup docker-entrypoint.sh mariadbd 2>&1 >/dev/null &
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache test plugins
uses: actions/cache@v4
with:
path: /tmp/*.zip
key: ${{ runner.os }}-test-plugins-${{ hashFiles('bin/download-test-deps.sh') }}
restore-keys: |
${{ runner.os }}-test-plugins-
- name: Composer install
run: composer -q install
- name: Wait for MariaDB
run: sleep 10
- name: Executable mode
run: chmod a+x bin/*
- name: Install tests suite
run: bin/install-wp-tests.sh
- name: Unit testing
run: vendor/bin/phpunit -c phpunit.xml.dist