Skip to content

Commit 09d5654

Browse files
committed
build: restructure CI build steps
1 parent 3d10279 commit 09d5654

File tree

2 files changed

+45
-16
lines changed

2 files changed

+45
-16
lines changed

.travis.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,28 @@ cache:
2424
directories:
2525
- node_modules
2626
before_install:
27-
# Skip updating shrinkwrap / lock
28-
- "npm config set shrinkwrap false"
29-
27+
# Configure npm
28+
- |
29+
# Skip updating shrinkwrap / lock
30+
npm config set shrinkwrap false
3031
# Remove all non-test dependencies
31-
- "npm rm --save-dev connect-redis"
32-
32+
- |
33+
# Remove example dependencies
34+
npm rm --silent --save-dev connect-redis
3335
# Update Node.js modules
34-
- "test ! -d node_modules || npm prune"
35-
- "test ! -d node_modules || npm rebuild"
36+
- |
37+
# Prune and rebuild node_modules
38+
if [[ -d node_modules ]]; then
39+
npm prune
40+
npm rebuild
41+
fi
3642
script:
37-
- "npm run test-ci"
38-
- "npm run lint"
39-
after_script: "npm install [email protected] && cat ./coverage/lcov.info | coveralls"
43+
# Run test script
44+
- npm run test-ci
45+
# Run linting
46+
- npm run lint
47+
after_script:
48+
- |
49+
# Upload coverage to coveralls
50+
npm install --save-dev [email protected]
51+
coveralls < ./coverage/lcov.info

appveyor.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,35 @@ environment:
1313
cache:
1414
- node_modules
1515
install:
16+
# Install Node.js
1617
- ps: >-
1718
try { Install-Product node $env:nodejs_version -ErrorAction Stop }
1819
catch { Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) }
19-
- npm config set shrinkwrap false
20-
- npm rm --save-dev connect-redis
21-
- if exist node_modules npm prune
22-
- if exist node_modules npm rebuild
20+
# Configure npm
21+
- ps: |
22+
# Skip updating shrinkwrap / lock
23+
npm config set shrinkwrap false
24+
# Remove all non-test dependencies
25+
- ps: |
26+
# Remove example dependencies
27+
npm rm --silent --save-dev connect-redis
28+
# Update Node.js modules
29+
- ps: |
30+
# Prune & rebuild node_modules
31+
if (Test-Path -Path node_modules) {
32+
npm prune
33+
npm rebuild
34+
}
35+
# Install Node.js modules
2336
- npm install
2437
build: off
2538
test_script:
26-
- node --version
27-
- npm --version
39+
# Output version data
40+
- ps: |
41+
node --version
42+
npm --version
43+
# Run test script
2844
- npm run test-ci
45+
# Run linting
2946
- npm run lint
3047
version: "{build}"

0 commit comments

Comments
 (0)