forked from webhintio/hint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
150 lines (114 loc) · 4.86 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
# For more information about the configurations used
# in this file, please see the Travis CI documentation.
#
# https://docs.travis-ci.com
addons:
chrome: stable
env:
global:
# GITHUB_API_TOKEN
- secure: "JR33kTopJFpEwCnFoh6UGgYYBiU480vltMfui3BRpz8G3zc75KctlChOq1lnzZXLm7Yx+7fx+zEOSoffOL2UrW5RnjfZeoWXb1M8IPfQGF7+AVkTm5fI+O7Z2v/Rq40zEDqT8J4Y5G/k+x3Wvsx6bywAKAUU6PO1zbdnZgKBblR63dDgmHWyrdwatpFQK7VF1DtTXtt+j7P4FiBXN2z2FB/6Uidboqf3DNIBH1wmhZXRFLeBpBubLcJR2FdPbzIE/OaU0iJ0kL4Zm0BecoEX4gfKmgZBtuE3Zr83O0UCXj8XkPWDA/m1I3QJB5BNl3pzv+PkmXxI05ioza5JeM5FmHc6I4X3X6x1GHpppXVZkxwe8WYCtgyfKWFcTy9YC2CV+7t0B0dj1ClzV+RS7q4wWdNKc020bzPle4A0u8FaqK4+IE7s9ciC2qr8r3hIkqgX2a4cDKD57V+fiLZG7BHdYLACmzTLx7rRpAnwhuUW9GUcxG0kb8fVgUZjaM/CI0rrf7kHut2gEDzeOpP9I8d13Oj+Ji1+TDZw8sxEopko5pxaoH8LmCnDn4GfA2b8vOMzJnrF2mcbumTwXLUzC8DNZZb8V/b00TZgCxkaeITDzPM9PpLcKNH4C2wTecc6O9vMRsWpEeirK8NaMpdE4GoSh1F2n+j4c0rxnCVM0ijidzk="
# TRAVIS_API_TOKEN
- secure: "IaW1CfeF12i16seRoO3tPQXw0IrF3ve/umcRpwCkmVgaxM0z/q5mJ+VCV25R67idqaGiSfVkdR5qb1q3q8eVKcMBhg/o6s4/7j3GGdm/5ixU5r8TOOfNUadsX2/e/pt4s5YE6+9NgSWshkwk81j9VBmmfQ1ClE0N0xS9uvjzn4YsZ7YSacrM02lEd5riPkVe0slxN0j0eGm50aum75MsPShM1WTGq9WdJyxd/Xpaia+2eBuiRCHu822dASLnoeVL6kyBmE4x86Ss17eR2VseaOS3XKRmFkdIDiPVO85B2EBaeqiyr4fHOqXTQm/WmWGCMSuzpQMRdksSNOCVrN/csmgajnhdye9f2kUdxTduu17TBcYzvkkoP2MRLglINcSCDHspDbI5177oIIBlE6nB9iawUWIIaiRATAmCBpllIGSA/zmvuztQM8YedjHA9E9o0yBXgyaFCHqz9N5fiZldKLU7do2OblPhwQoKzbUhs7+egpuVTnYp76NiqqipRV8gyCDjXCNWtXR/yba3UT5/3PIozL29mxxM41WIuhVhSXgVKhOzDSTYO5z8kB4S8L5dhVY9gLgXi0qnFU4d+Gsiy69lbZ9zXeK0occjMi/b0rkSOwovGmAZU2ArwUh7XRPbFZuCwxwaF/HBqaInsodRveuuOw7RbZh978kQKDf5J9g="
# Other
- PACKAGE_BATCH_SIZE=2
matrix:
- PACKAGE_BATCH_NUMBER=1
- PACKAGE_BATCH_NUMBER=2
group: travis_latest
before_install:
- |
# Only install the bare minimum of dependencies in order
# to run the test script.
npm i && \
# Run the test script without actually running the tests.
#
# This will make the test script create a special file
# that will be used to optimize other steps to (e.g.:
# install, scripts) to not do anything if no tests need
# to be run.
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# This workaround is used because Travis evaluates things
# too late and there is no way to use a function to conditionally
# prevent Travis from starting a job.
#
# From https://docs.travis-ci.com/user/conditions-v1#Integration:
#
# "Also, environment variables from your build configuration
# (.travis.yml) and repository settings are available, and
# can be matched using env(FOO), see below.
#
# Note that this means conditions do not have access to the
# build environment, and they are not evaluated in Bash.
# Bash variables or subprocesses can not be evaluated. "
npm run test -- --batch-size $PACKAGE_BATCH_SIZE \
--batch-number $PACKAGE_BATCH_NUMBER \
--run-tests false
install:
- |
# Only install the dependencies if the test script created
# the special file. Otherwise, don't start the normal (time
# consuming) install process as the job will not have to run
# any actual tests.
#
# (For more information see: `before_install` step)
if [ -f '.ci-run-tests' ]; then
rm -rf node_modules && yarn
fi
jobs:
include:
# Stage used for checking for broken links.
#
# [!] Runs: Only if the build was triggered by a cron job
# (which is automatically run once per week).
- stage: check-links
if: |
branch = master and \
type = cron
node_js: lts/*
os: linux
script: ./.travis/check-links.sh
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Stage used for deploying different things (e.g.: trigger and
# deploy a site update).
#
# [!] Runs: Only if the build was was triggered because a push
# to the `master` branch.
- stage: deploy
if: |
branch = master and \
type = push
node_js: lts/*
os: linux
script: ./.travis/trigger-site-update.sh
language: node_js
node_js:
- lts/*
- node
notifications:
email:
on_failure: always
on_success: never
os:
- linux
- osx
script:
- |
# Only run the tests if the test script created the
# special file. Otherwise, don't start the normal
# (time consuming) test process as the job will not
# have to run any actual tests.
#
# (For more information see: `before_install` step)
if [ -f '.ci-run-tests' ]; then
yarn test --batch-size $PACKAGE_BATCH_SIZE \
--batch-number $PACKAGE_BATCH_NUMBER
fi
stages:
- check-links
- name: test
if: type != cron
- deploy
sudo: required