forked from Automattic/jetpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
186 lines (166 loc) · 5.48 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Travis CI Configuration File
# Tell Travis CI which distro to use
dist: trusty
# Tell Travis CI we're using PHP
language: php
services:
- docker
# Run Matrix for these PHP versions
php:
- "5.6"
- "7.0"
- "7.2"
- "7.3"
- "7.4snapshot"
env:
# Global variable is re-defined in matrix-include -list
global:
- WP_TRAVISCI=phpunit
# Run phpunit in Travis matrix for these combinations
matrix:
- WP_BRANCH=master SIMPLE_AND_MULTISITE=1 # SIMPLE_AND_MULTISITE is just a way to explicitly mention that we run both suites
- WP_BRANCH=latest
- WP_BRANCH=previous PHP_LINT=1
# Define a matrix of additional build configurations
# The versions listed above will automatically create our first configuration,
# so it doesn't need to be re-defined below.
matrix:
fast_finish: true
include:
- if: branch !~ /(^branch-.*-built)/
name: "JavaScript & CSS lint"
language: node_js
env: WP_TRAVISCI="yarn lint"
- if: branch !~ /(^branch-.*-built)/
name: "Danger CI, test dashboard & extensions"
language: node_js
env: WP_TRAVISCI="yarn test-dangerci-and-adminpage-and-extensions"
- if: branch !~ /(^branch-.*-built)/
name: "Build dashboard & extensions"
language: node_js
env: WP_TRAVISCI="yarn build"
# Disable for now until we fix all the spelling issues
# - name: "Spell check Markdown files"
# if: branch !~ /(^branch-.*-built)/
# language: node_js
# env: WP_TRAVISCI="yarn test-spelling"
- php: "nightly"
name: "PHP Nightly"
# Code Climate code coverage.
- php: "7.3"
name: "Code Coverage"
env:
- WP_BRANCH=previous
- DO_COVERAGE=true
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- export PLUGIN_SLUG=$(basename $(pwd))
- ./tests/setup-travis.sh
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t clover -p /tmp/wordpress-previous/src/wp-content/plugins/jetpack
- php: "7.0"
name: "E2E tests"
# Since build secrets are not available for forks, we would not be able to (and don't want) decrypt the config file
# so we just skip the E2E job all together
if: branch !~ /(^branch-.*-built)/ AND env(RUN_E2E) = true AND fork = false
before_script:
# Enable user namespace cloning
- "sysctl kernel.unprivileged_userns_clone=1"
- nvm install
- yarn && yarn build-production
- ./tests/e2e/bin/setup-e2e-travis.sh
- yarn test-decrypt-config
script:
- yarn test-e2e --runInBand --verbose
after_script:
- sudo apt-add-repository -y ppa:qameta/allure
- sudo apt-get update
- sudo apt-get -y install allure
- ./tests/e2e/bin/push-allure-artifacts.sh
addons:
apt:
packages:
- nginx
# This is required to run new chrome on old trusty
- libnss3
- php: "7.0"
name: "Legacy full sync"
env: LEGACY_FULL_SYNC=1 WP_BRANCH=latest
- php: "7.4"
name: "E2E tests latest Gutenberg"
env: LATEST_GUTENBERG=1
# Since build secrets are not available for forks, we would not be able to (and don't want) decrypt the config file
# so we just skip the E2E job all together
if: branch !~ /(^branch-.*-built)/ AND env(RUN_E2E) = true AND fork = false
before_script:
# Enable user namespace cloning
- "sysctl kernel.unprivileged_userns_clone=1"
- nvm install
- yarn && yarn build-production
- ./tests/e2e/bin/setup-e2e-travis.sh
- yarn test-decrypt-config
script:
- yarn test-e2e --runInBand --verbose
after_script:
- sudo apt-add-repository -y ppa:qameta/allure
- sudo apt-get update
- sudo apt-get -y install allure
- ./tests/e2e/bin/push-allure-artifacts.sh
addons:
apt:
packages:
- nginx
# This is required to run new chrome on old trusty
- libnss3
allow_failures:
- name: "PHP Nightly"
- name: "Spell check Markdown files"
- name: "Code Coverage"
- name: "E2E tests"
- name: "E2E tests latest Gutenberg"
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/.cache/yarn
- $HOME/.phpbrew
# whitelist branches for the "push" build check
branches:
only:
- master
- master-stable
- /^branch-.*$/
- /^feature\/.*$/
# Git clone depth
# By default Travis CI clones repositories to a depth of 50 commits
git:
depth: 1
before_script:
- export PLUGIN_SLUG=$(basename $(pwd))
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- ./tests/setup-travis.sh
script: ./tests/run-travis.sh
sudo: false
notifications:
webhooks:
urls:
- https://betadownload.jetpack.me/travis.php
on_success: always # Beta builder needs notifications for successful builds
email:
on_success: never # default: change
recipients:
# Encrypted Slack notification address
- secure: "WQdTdmYuifSW0hiJGXpQGKystMASC50QvxHlyUL5SM3h5GP8aCgeSsHuXvKPe3dT3Pffhk0dSHBfDtdWFwSHW/upURhg0vs4dm7+nxxvGZiTPzKcuAIjgvCoqWM7teyda/XqFGNSnv+XsT34uoyPhhFgd45T3oS+QQ3aNCruFak="
addons:
code_climate:
repo_token: 683bd559e5214ca3b721092af177893f05765ba90d2589fcf35d7e85c6ea01e8