forked from wp-graphql/wp-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
71 lines (63 loc) · 1.85 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
sudo: required
services:
- docker
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/
- PHP_VERSION=5.6
- PHP_VERSION=7.1
- PHP_VERSION=7.2 APIGEN_DOCS=true COVERAGE=true LINT_SCHEMA=true
script:
- ./run-docker-tests.sh wpunit
- ./run-docker-tests.sh functional
- ./run-docker-tests.sh acceptance
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
# Generate the APIGen Docs
# - |
# if [ $APIGEN_DOCS == true ]; then
# cd $TRAVIS_BUILD_DIR
# vendor/bin/apigen generate --source="src" --destination $TRAVIS_BUILD_DIR/apigen
# fi
deploy:
# Deploy the Generated API docs to the wp-graphql-api-docs repo
- provider: pages
# This is set in the Travis CI dashboard
github_token: $APIGEN_GITHUB_TOKEN
local_dir: $TRAVIS_BUILD_DIR/apigen
repo: wp-graphql/wp-graphql-api-docs
target_branch: master
# Make sure this is true to ensure the files that were built in the previous step are not cleaned up before deploy
skip_cleanup: true
on:
# Probably switch this to master?
all_branches: develop
# Only deploy when APIGEN_DOCS are generated
condition: $APIGEN_DOCS == true