Skip to content

Commit

Permalink
Merge pull request #38 from adambullmer/circle-2.0
Browse files Browse the repository at this point in the history
Upgraded to circle 2.0
  • Loading branch information
adambullmer authored Jul 14, 2017
2 parents c9d261e + 9333505 commit dff9f55
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 20 deletions.
75 changes: 75 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
defaults: &defaults
working_directory: /angular-bro-app
docker:
- image: adambullmer/circleci-node:6.10.3

version: 2
jobs:
build:
<<: *defaults
steps:
- checkout
- run:
name: npm-config
command: 'npm config set progress=false'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: install-npm
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- persist_to_workspace:
root: .
paths:
- node_modules

test:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: /angular-bro-app
- run:
name: unit-tests
command: npm run test -- --reporter mocha-junit-reporter --reporter-options mochaFile=$(pwd)/junit/test-results.xml
- run:
name: collect-coverage
command: npm run coverage -- --report-dir coverage/
# - run:
# name: report-coveralls-coverage
# command: npm run coveralls
- store_test_results:
path: /angular-bro-app/junit
- store_artifacts:
path: coverage
prefix: coverage

deploy:
<<: *defaults
steps:
- checkout
- run:
name: prep-node-credentials
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- run:
name: publish-npm
command: npm publish

workflows:
version: 2
build_and_test:
jobs:
- build
- test:
requires:
- build
- deploy:
requires:
- build
- test
filters:
branches:
only: master
13 changes: 13 additions & 0 deletions .circleci/images/primary/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine:3.6
MAINTAINER Adam Bullmer <[email protected]>

RUN apk update && \
apk add --no-cache \
git \
tar \
gzip \
ca-certificates \
nodejs \
nodejs-npm \
&& \
rm -rf /var/cache/apk/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
.nyc_output
coverage
18 changes: 0 additions & 18 deletions circle.yml

This file was deleted.

12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"description": "Angular broccoli plugin and compilation routine",
"main": "lib/angular-app.js",
"scripts": {
"test": "eslint lib/*.js"
"test": "nyc mocha 'test/**/*.test.js'",
"posttest": "npm run coverage",
"lint": "eslint .",
"coverage": "nyc report --reporter=html",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -59,7 +63,11 @@
"lodash": "^4.6.1"
},
"devDependencies": {
"eslint": "^3.18.0"
"coveralls": "^2.13.1",
"mocha": "^3.2.0",
"mocha-eslint": "^4.0.0",
"mocha-junit-reporter": "^1.13.0",
"nyc": "^11.0.3"
},
"peerDependencies": {
"phantomjs-prebuilt": "^2.1.6"
Expand Down
15 changes: 15 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": "../.eslintrc",
"rules": {
"prefer-arrow-callback": "off",
"global-require": "off",
"no-invalid-this": "off",
"no-empty-function": "off",
"max-lines": "off"
}
}
12 changes: 12 additions & 0 deletions test/lint.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Run ESLint as Mocha Tests
*/
const LINTER_SLOW = 1000,
lint = require('mocha-eslint'),
paths = [
'lib/**/*.js',
'test/**/*.test.js',
],
options = { slow: LINTER_SLOW };

lint(paths, options);

0 comments on commit dff9f55

Please sign in to comment.