-
Notifications
You must be signed in to change notification settings - Fork 101
127 lines (105 loc) · 4.04 KB
/
core-tests.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
name: CI (WP Core)
on:
push:
branches:
- develop
- staging
- production
- gh-readonly-queue/**
pull_request:
branches:
- develop
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
LOCAL_PHP: "8.0-fpm"
LOCAL_DB_TYPE: "mysql"
LOCAL_DB_VERSION: "8.0"
LOCAL_PHP_MEMCACHED: "true"
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
jobs:
wp-core:
name: "Run WP Core Tests"
runs-on: ubuntu-latest
steps:
- name: Get the latest WP version
id: version
run: |
echo "latest=$(curl -s https://api.wordpress.org/core/version-check/1.7/ | jq -r '.offers | map(select( .response == "upgrade")) | .[0].version')" >> $GITHUB_OUTPUT
- name: Configure environment variables
run: |
echo "PHP_FPM_UID=$(id -u)" >> "${GITHUB_ENV}"
echo "PHP_FPM_GID=$(id -g)" >> "${GITHUB_ENV}"
- name: Checkout WordPress
uses: actions/[email protected] # v4.0.0
with:
repository: wordpress/wordpress-develop
path: wordpress
ref: ${{ steps.version.outputs.latest }}
- name: Check out source code
uses: actions/[email protected] # v4.0.0
with:
submodules: recursive
path: wordpress/src/wp-content/mu-plugins
- name: Tweaks
run: |
echo "define( 'VIP_JETPACK_SKIP_LOAD', 'true' );" >> "wordpress/src/wp-content/mu-plugins/000-vip-init.php"
echo "GITHUB_EVENT_NAME=pull_request" >> "wordpress/.env"
- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version-file: 'wordpress/.nvmrc'
cache: npm
cache-dependency-path: 'wordpress/package-lock.json'
- name: Set up PHP
uses: shivammathur/[email protected]
with:
php-version: 8.0
coverage: none
# - name: Install Composer dependencies
# uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
# with:
# working-directory: wordpress
- name: Install Composer dependencies
run: composer install -n
working-directory: wordpress
- name: Downgrade PHPUnit
run: composer require --dev -n phpunit/phpunit:9.6.12
working-directory: wordpress
- name: Install npm dependencies
run: npm ci
working-directory: wordpress
- name: Start Docker environment
run: npm run env:start
working-directory: wordpress
- name: Log running Docker containers
run: docker ps -a
- name: WordPress Docker container debug information
run: |
docker-compose run --rm mysql mysql --version
docker-compose run --rm php php --version
docker-compose run --rm php php -m
docker-compose run --rm php php -i
docker-compose run --rm php locale -a
working-directory: wordpress
- name: Install WordPress
run: npm run env:install
working-directory: wordpress
- name: Run PHPUnit tests
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist
working-directory: wordpress
- name: Run AJAX tests
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group ajax
working-directory: wordpress
- name: Run ms-files tests as a multisite install
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files
working-directory: wordpress
- name: Run external HTTP tests
run: |
sed -i 's/ test_multiple_location_headers/ disabled_test_multiple_location_headers/' tests/phpunit/tests/http/base.php
node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http
working-directory: wordpress