-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
97 lines (81 loc) · 2.77 KB
/
.travis.yml
File metadata and controls
97 lines (81 loc) · 2.77 KB
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
# 1. Set-up
env:
global: CC_TEST_REPORTER_ID="$CC_TEST_REPORTER_ID" CC_TEST_REPORTER_TYPE=
language: node_js
cache: npm
# 1.1. Run quality assurance (QA) gates on all
# supported Node.js versions...
node_js:
- "11"
- "10"
- "8"
- "6"
# 1.2. ...on both Linux and MacOS
# @see https://github.com/nodejs/Release#release-schedule
os:
- linux
- osx
# 1.3. Do a shallow-clone to speed up analysis
# (fail fast!)
git:
depth: 1
before_install:
# 2. Before installation (before_install) steps:
# 2.1. Set up dependency manager (node package manager "npm")
- '[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest'
# 2.2. FOSS license-compliance evaluator (fossa-cli for Provided Builds)
# Grant execution permission
# @see https://docs.fossa.com/docs/provided-builds
- chmod +x ./.github/ci/legal/fossa-init.sh
# 2.3. CodeClimate source code quality assessor
# Grant execution permission
- chmod +x ./.github/ci/qa/code-climate-init.sh
install:
# 3. Installation step (install):
- npm i
before_script:
# 4. Before running unit tests...
# 4.1. Initialize FOSSA for OSS license compliance evaluation
- ./.github/ci/legal/fossa-init.sh
# 4.2. Initialize CodeClimate for quality assurance code review
# automatically sent as comments during a Merge Request
# to master.
- ./.github/ci/qa/code-climate-init.sh
# 4.3. Initialize CodeClimate Code Coverage reporter
- $TRAVIS_BUILD_DIR/cc-test-reporter before-build || exit 0
script:
# 5. Test!
- npm test
- npm run security:audit:dependencies
after_script:
# 5.1. Share code coverage with
# - Codacy,
# - Coveralls,
- npm run ci:coverage
# - and CodeClimate
- $TRAVIS_BUILD_DIR/cc-test-reporter after-build --exit-code
$TRAVIS_TEST_RESULT || exit 0
jobs:
include:
- stage: release
name: 'Publish to NPM (public registry)'
# 7. Deploy from the lastest Node.js Long-Term Support
# (LTS) build.
node_js: lts/*
deploy:
provider: script
skip_cleanup: true
script:
# 7.1. Bump semantic version by commit message headers' "type"
# 7.2. Generate GitHub Release Notes
# 7.3. Append change list to the CHANGELOG.md
# 7.4. Bump package.json#version
# 7.5. Stage and commit all of the above
# 7.6. Push to Git remote origin master
# 7.7. Trigger all CI quality gates on master
# 7.8. All gates pass (steps 1-6)? Bump semver and
# 7.8.1. Squash and merge into origin/master
# 7.8.2. Publish a GitHub release with notes and CHANGELOG
# 7.8.3. Publish on NPM (including README)
# 7.9. Any gate fails? Roll back and abort all release steps.
- npx semantic-release