Skip to content

Commit f030f23

Browse files
author
Felix Arntz
committed
Support lookup for latest WP version on Travis.
1 parent 401f768 commit f030f23

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.travis.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ php:
1313
- 7.0
1414
- 7.1
1515
env:
16-
- WP_VERSION=4.9
16+
- WP_VERSION=latest
1717
- WP_VERSION=4.5
1818
dist: trusty
1919
matrix:
2020
include:
2121
- php: 5.2
22-
env: WP_VERSION=4.9
22+
env: WP_VERSION=latest
2323
dist: precise
2424
- php: 5.2
2525
env: WP_VERSION=4.5
2626
dist: precise
2727
- php: 5.3
28-
env: WP_VERSION=4.9
28+
env: WP_VERSION=latest
2929
dist: precise
3030
- php: 5.3
3131
env: WP_VERSION=4.5
3232
dist: precise
3333
- php: 5.6
34-
env: WP_VERSION=4.9 WP_MULTISITE=1
34+
env: WP_VERSION=latest WP_MULTISITE=1
3535
- php: 5.6
3636
env: WP_VERSION=4.5 WP_MULTISITE=1
3737
- php: 7.0
@@ -78,6 +78,12 @@ before_script:
7878
else
7979
composer install
8080
fi
81+
- |
82+
if [[ "$WP_VERSION" == "latest" ]]; then
83+
curl -s http://api.wordpress.org/core/version-check/1.7/ > /tmp/wp-latest.json
84+
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
85+
WP_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
86+
fi
8187
- |
8288
if [[ "$NPM_TESTS" != "1" ]]; then
8389
PLUGIN_SLUG=$(basename $(pwd))

0 commit comments

Comments
 (0)