Skip to content

Commit

Permalink
feat(ci): improve continuous integration
Browse files Browse the repository at this point in the history
Continuous integration improvements
- Travis builds no longer run on non-master branch pushes
- TravisBuddy integration
- Unit tests (code correctness) and validation checks (everything else) run in parallel
- add semantic-release to automate publishing once PRs merge
- add commitlint as part of travis build
  • Loading branch information
Eric Fischer committed Apr 24, 2018
1 parent cb96fba commit 5b09057
Show file tree
Hide file tree
Showing 9 changed files with 4,549 additions and 2,555 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-angular"]
}
27 changes: 27 additions & 0 deletions .releaserc
@@ -0,0 +1,27 @@
{
"branch": master",
"tagFormat": "v${version}",
"verifyConditions": [
"@semantic-release/npm",
{
"path": "@semantic-release/github",
"assets": {
"path": "dist/*"
}
}
],
"analyzeCommits": "@semantic-release/commit-analyzer",
"generateNotes": "@semantic-release/release-notes-generator",
"prepare": "@semantic-release/npm",
"publish": [
"@semantic-release/npm",
{
"path": "@semantic-release/github",
"assets": {
"path": "dist/*"
}
}
],
"success": [],
"fail": []
}
39 changes: 29 additions & 10 deletions .travis.yml
@@ -1,17 +1,36 @@
language: node_js

node_js:
- 8.9.4

branches:
only:
- master
- /v\d+\.\d+\.d+$/

cache:
directory:
- studio-frontend/node_modules/
directories:
- "node_modules"

script:
- make package-lock.validate
- make i18n.pre_validate
- npm run lint
- npm run test
stages:
- PR checks ✅
- name: Ship It 🚢
if: env(TRAVIS_BRANCH) = master
jobs:
include:
- stage: PR checks ✅
env:
- NAME=Unit Tests
script: npm run test
after_script:
- codecov
- stage: PR checks ✅
env:
- NAME=Validation Checks
script: ./.travis/validate_changes_for_merge.sh
- stage: Ship It 🚢
env:
- NAME=Publish
script: rm -rf dist/ && rm -rf node_modules/ && npm install && npm run build && semantic-release

after_script:
- codecov
notifications:
webhooks: https://www.travisbuddy.com/
10 changes: 10 additions & 0 deletions .travis/validate_changes_for_merge.sh
@@ -0,0 +1,10 @@
#!/bin/bash

# This script exists so that all validation checks can be run in parallel with a single compound exit status

EXIT_STATUS=0
npm run lint || EXIT_STATUS=$?
make package-lock.validate || EXIT_STATUS=$?
make i18n.pre_validate || EXIT_STATUS=$?
commitlint-travis || EXIT_STATUS=$?
exit $EXIT_STATUS

0 comments on commit 5b09057

Please sign in to comment.