Skip to content

Commit

Permalink
Merge pull request aurelia#618 from fkleuver/master
Browse files Browse the repository at this point in the history
chore(ci): upgrade to circleci 2.0
  • Loading branch information
EisenbergEffect authored Sep 2, 2018
2 parents 2a8a166 + eb9e985 commit 8d20410
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 23 deletions.
70 changes: 70 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Defaults for all jobs

defaults: &defaults
working_directory: ~/repo
docker:
- image: aureliaeffect/circleci-v1:latest

# Variables
var_1: &cache_key aurelia-{{ .Branch }}-{{ checksum "package.json" }}{{ checksum "package-lock.json" }}

version: 2
jobs:
install:
<<: *defaults
steps:
- checkout
- run: npm ci
- run: jspm install
- run: git checkout -- package.json
- save_cache:
key: *cache_key
paths:
- node_modules
- jspm_packages

build:
<<: *defaults
steps:
- checkout
- restore_cache:
key: *cache_key
- run: gulp build
- store_artifacts:
path: ./dist

unit_tests:
<<: *defaults
steps:
- checkout
- restore_cache:
key: *cache_key
- run: gulp cover
- run: codecov -f ./build/reports/coverage/coverage-final.json
- store_test_results:
path: ./build/reports/coverage
- store_artifacts:
path: ./build/reports/coverage

lint:
<<: *defaults
steps:
- checkout
- restore_cache:
key: *cache_key
- run: gulp lint

workflows:
version: 2
default_workflow:
jobs:
- install
- build:
requires:
- install
- unit_tests:
requires:
- install
- lint:
requires:
- install
23 changes: 23 additions & 0 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,26 @@ gulp.task('coveralls', ['test'], function (done) {
gulp.src('build/reports/coverage/lcov/report-lcovonly.txt')
.pipe(coveralls());
});


/**
* Run test once with code coverage and exit
*/
gulp.task('cover', function (done) {
new karma.Server({
configFile: __dirname + '/../../karma.conf.js',
singleRun: true,
reporters: ['progress', 'coverage'],
preprocessors: {
'test/**/*.js': ['babel'],
'src/**/*.js': ['babel', 'coverage']
},
coverageReporter: {
dir: 'build/reports/coverage',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'json', subdir: '.', file: 'coverage-final.json' }
]
}
}, done).start();
});
23 changes: 0 additions & 23 deletions circle.yml

This file was deleted.

0 comments on commit 8d20410

Please sign in to comment.