-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
80 lines (66 loc) · 1.77 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
language: node_js
node_js:
- '12'
env:
global:
- FORCE_COLOR=1 # Ensure colored output (color support is not detected in some cases)
git:
# Minimize git history, but ensure to not break things:
# - Merging multiple PR's around same time may introduce a case where it's not
# the last merge commit that is to be tested
# - Aside of merge commit we need a previous commit to be able to detect a version switch
depth: 30
stages:
- install
- build
- test
- name: release
if: tag =~ ^v\d+\.\d+\.\d+$
before_script:
- set -e
- git config --global user.email "github@github.com"
- git config --global user.name "GitHub CI"
# Ensure to fail build if deploy fails, Travis doesn't ensure that: https://github.com/travis-ci/travis-ci/issues/921
before_deploy:
- set -e
# Remove eventual old npm logs
- rm -rf ~/.npm/_logs
after_deploy:
- |
# npm creates log only on failure
if [ -d ~/.npm/_logs ]; then
# Undocumented way to force Travis build to fail
travis_terminate 1
fi
jobs:
include:
- stage: install
name: 'Install'
script:
- npm run install
- stage: build
name: 'Build'
script:
- npm run all
- stage: test
name: 'Test'
script:
- npm run test:all
- stage: release
name: 'Release'
deploy:
provider: script
skip_cleanup: true
on:
tags: true
script: npx -p @semantic-release/release-notes-generator -p @semantic-release/npm -p @semantic-release/github semantic-release
after_success:
- bash <(curl -s https://codecov.io/bash)
branches:
only:
- master # Do not build PR branches
- /^v\d+\.\d+\.\d+$/ # Ensure to build release tags
cache:
directories:
- $HOME/.npm
- node_modules