forked from wp-graphql/wp-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
82 lines (69 loc) · 2 KB
/
.travis.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
sudo: required
services:
- docker
language: php
notifications:
email:
on_success: never
on_failure: never
branches:
only:
- master
- develop
cache:
apt: true
# Set the global environment variables
env:
matrix:
# These apply to the latest WP version that is available as a Docker image: https://hub.docker.com/_/wordpress/
# Disabling PHP 5.6 tests until "composer.lock" is updated to work with PHP 7.X AND 5.6.
# - WP_VERSION=5.0.2 PHP_VERSION=5.6
- WP_VERSION=5.2.3 PHP_VERSION=7.1
- WP_VERSION=5.2.3 PHP_VERSION=7.2
- WP_VERSION=5.2.3 PHP_VERSION=7.3 COVERAGE=true LINT_SCHEMA=true
- PHPCS=true
matrix:
allow_failures:
- env: PHPCS=true
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- |
# Remove Xdebug for a huge performance increase:
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
before_script:
# Install PHP CodeSniffer and WPCS.
- |
if [[ "$PHPCS" == "true" ]]; then
composer install
phpenv rehash
fi
script:
- ./run-docker-tests.sh 'wpunit'
- ./run-docker-tests.sh 'functional'
- ./run-docker-tests.sh 'acceptance'
- if [[ "$PHPCS" == "true" ]]; then composer check-cs; fi
after_success:
# Upload coverage to codecov
- |
if [[ "${COVERAGE}" == 'true' ]]; then
bash <(curl -s https://codecov.io/bash)
fi
# Install GraphQL Schema Linter
# Move to the WordPress Install
# Generate the Static Schema
# Lint the Schema
- |
if [ $LINT_SCHEMA == true ]; then
npm install -g graphql-schema-linter
cd $WP_CORE_DIR
wp graphql generate-static-schema
cd $WP_CORE_DIR/wp-content/plugins/wp-graphql
graphql-schema-linter ./schema.graphql
fi