Skip to content

Commit

Permalink
build: restructure CI build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Sep 22, 2018
1 parent 3d10279 commit 09d5654
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 16 deletions.
32 changes: 22 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,28 @@ cache:
directories:
- node_modules
before_install:
# Skip updating shrinkwrap / lock
- "npm config set shrinkwrap false"

# Configure npm
- |
# Skip updating shrinkwrap / lock
npm config set shrinkwrap false
# Remove all non-test dependencies
- "npm rm --save-dev connect-redis"

- |
# Remove example dependencies
npm rm --silent --save-dev connect-redis
# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
- |
# Prune and rebuild node_modules
if [[ -d node_modules ]]; then
npm prune
npm rebuild
fi
script:
- "npm run test-ci"
- "npm run lint"
after_script: "npm install [email protected] && cat ./coverage/lcov.info | coveralls"
# Run test script
- npm run test-ci
# Run linting
- npm run lint
after_script:
- |
# Upload coverage to coveralls
npm install --save-dev [email protected]
coveralls < ./coverage/lcov.info
29 changes: 23 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,35 @@ environment:
cache:
- node_modules
install:
# Install Node.js
- ps: >-
try { Install-Product node $env:nodejs_version -ErrorAction Stop }
catch { Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) }
- npm config set shrinkwrap false
- npm rm --save-dev connect-redis
- if exist node_modules npm prune
- if exist node_modules npm rebuild
# Configure npm
- ps: |
# Skip updating shrinkwrap / lock
npm config set shrinkwrap false
# Remove all non-test dependencies
- ps: |
# Remove example dependencies
npm rm --silent --save-dev connect-redis
# Update Node.js modules
- ps: |
# Prune & rebuild node_modules
if (Test-Path -Path node_modules) {
npm prune
npm rebuild
}
# Install Node.js modules
- npm install
build: off
test_script:
- node --version
- npm --version
# Output version data
- ps: |
node --version
npm --version
# Run test script
- npm run test-ci
# Run linting
- npm run lint
version: "{build}"

0 comments on commit 09d5654

Please sign in to comment.