forked from octokit/octokit.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
87 lines (82 loc) · 2.54 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
language: node_js
cache:
directories:
- ~/.npm
- node_modules/cypress/dist
# Trigger a push build on master and greenkeeper branches + PRs build on every branches
# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
branches:
only:
- master
- /^greenkeeper.*$/
stages:
- test
- name: greenkeeper-routes-update
if: branch =~ ^greenkeeper/@octokit/routes
- name: release
if: branch = master AND type IN (push)
jobs:
include:
- stage: test
node_js: 6
script:
- npm run start-fixtures-server &
- sleep 3 # give server some time to start
- npm run test
- node_js: 8
script:
- npm run start-fixtures-server &
- sleep 3 # give server some time to start
- npm run test
- node_js: 9
env: Node 9, coverage upload
script:
- npm run start-fixtures-server &
- sleep 3 # give server some time to start
- npm run test
- npm run coverage:upload
- node_js: 4 # will be removed in v16
env: Node 4, smoke test only
script:
- node index.js
- node_js: lts/*
env: browser tests
script:
- npm run start-fixtures-server &
- sleep 3 # give server some time to start
- npm run test:browser
- node_js: lts/*
sudo: required
addons:
chrome: stable
env: bundle size, typescript validation
script:
# test bundle size
- npm run build:browser
- npx bundlesize
# test typescript definitions
- npm run validate:ts
# when updating @octokit/routes, run "generate-routes" script and push
# new routes.json file to the pull request
- stage: greenkeeper-routes-update
node_js: lts/*
script:
- git checkout $TRAVIS_BRANCH
- npm run generate-routes
# commit changes and push back to branch on GitHub. If there are no changes then exit without error
- 'git commit -a -m "build: routes" --author="Octokit Bot <octokitbot@martynus.net>" && git push "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" ${TRAVIS_BRANCH} || true'
# release stage: run semantic release & update the docs
- stage: release
node_js: lts/*
env: semantic-release
script:
- npm run build:flow
- npm run build:ts
- npm run build:browser
- npm run generate-bundle-report
- npm run semantic-release
- node_js: lts/*
env: docs update
script:
- npm run build:docs
- npm run deploy-docs