forked from octokit/octokit.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
115 lines (109 loc) · 4.02 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
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
- next
- /^greenkeeper.*$/
stages:
- name: greenkeeper-routes-update
if: branch =~ ^greenkeeper/@octokit/routes
- test
- name: release
if: branch = master AND type IN (push)
install: npm ci
jobs:
include:
- stage: test
# spead up build times by removing unneeded dev dependencies
before_install:
- npm install -g npm@6
- npm uninstall leakage semantic-release
node_js: 6
script:
- npm run start-fixtures-server &
- sleep 3 # give server some time to start
- npm run test
- node_js: 8
# spead up build times by removing unneeded dev dependencies
before_install: npm uninstall leakage cypress semantic-release
script:
- npm run start-fixtures-server &
- sleep 3 # give server some time to start
- npm run test
- node_js: 10
# g++-4.8 required for "leakage"
# see https://github.com/andywer/leakage/tree/a10c0f6da542b238c73fe485e0317c1f1bce77ee#travis-ci
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
# spead up build times by removing unneeded dev dependencies
before_install: npm uninstall cypress semantic-release
env: Node 10, memory test, coverage upload
script:
- npm run start-fixtures-server &
- sleep 3 # give server some time to start
- npm run test
- npm run test:memory
# ignore error as coveralls is down frequently so we ignore errors
- npx nyc report --reporter=text-lcov | npx coveralls || true
- node_js: lts/*
# spead up build times by removing unneeded dev dependencies
before_install: npm uninstall leakage semantic-release
env: browser tests
addons:
apt:
packages:
# Ubuntu 16+ does not install this dependency by default, so we need to install it ourselves
- libgconf-2-4
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
# spead up build times by removing unneeded dev dependencies
before_install: npm uninstall leakage cypress semantic-release
env: bundle size, typescript validation
script:
# test bundle size
- npm run build:browser
- npx bundlesize
# test typescript definitions
- npm run validate:ts
- node_js: lts/*
env: folder size
install: npm install --production
script: npx get-folder-size --folder=node_modules/ | grep "^[01]\."
# 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/*
# spead up build times by removing unneeded dev dependencies
before_install: npm uninstall leakage cypress semantic-release
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 plugins/rest-api-endpoints/routes.json -m "build: routes" --author="Octokit Bot <[email protected]>" && git push "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" ${TRAVIS_BRANCH} || true'
# build assets and release new version with semantic-release
- stage: release
node_js: lts/*
# spead up build times by removing unneeded dev dependencies
before_install: npm uninstall leakage cypress
env: semantic-release
script:
- npm run build:ts
- npm run build:browser
- npm run generate-bundle-report
- npx semantic-release