forked from nock/nock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
48 lines (45 loc) · 1.51 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
language: node_js
cache: npm
# 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.*$/
- beta # semantic-release preview releases
- next # semantic-release @next releases
- /^\d+\.x$/ # semantic-release maintenance releases
stages:
- lint
- test
- name: release
if: branch =~ /^(\d+\.x|master|next|beta)$/ AND type IN (push)
- name: update-prettier
if: branch =~ ^greenkeeper/prettier
jobs:
include:
- stage: update-prettier
node_js: lts/*
script:
- git checkout $TRAVIS_BRANCH
- npm run prettier
# commit changes and push back to branch on GitHub. If there are no changes then exit without error
- 'git commit -a -m "style: prettier" && git push "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" ${TRAVIS_BRANCH} || true'
- stage: lint
node_js: lts/*
env: linting
# Show prettier errors, even if lint fails.
script: run-s --silent --continue-on-error lint prettier:check
- stage: test
node_js: 12
- node_js: 10
# Avoid running lint and prettier again.
script: npm run --silent unit
- node_js: 8
# Avoid running lint and prettier again.
script: npm run --silent unit
after_script: npm run coverage:upload
- stage: release
node_js: lts/*
env: semantic-release
script: npm run semantic-release