-
Notifications
You must be signed in to change notification settings - Fork 101
102 lines (83 loc) · 3.23 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
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:
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: Check out WordPress
uses: actions/[email protected]
with:
repository: wordpress/wordpress-develop
path: wordpress
ref: ${{ steps.version.outputs.latest }}
- name: Check out source code
uses: actions/[email protected]
with:
submodules: recursive
path: wordpress/src/wp-content/mu-plugins
- name: Patch package.json for WP 6.2.2
run: |
sed -i 's/"version": "6.2.3"/"version": "6.2.2"/' wordpress/package.json
if: steps.version.outputs.latest == '6.2.2'
- 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: Install NodeJS
uses: actions/[email protected]
with:
node-version-file: 'wordpress/.nvmrc'
cache: npm
cache-dependency-path: 'wordpress/package-lock.json'
- name: Install Dependencies
run: npm ci
working-directory: wordpress
- name: Install Composer dependencies
run: docker-compose run --rm php composer update
working-directory: wordpress
- name: Start Docker environment
run: npm run env:start
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