Skip to content

Commit

Permalink
Added CircleCI config
Browse files Browse the repository at this point in the history
  • Loading branch information
etki committed Mar 20, 2018
1 parent 0bc7eec commit fa1665d
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 1 deletion.
74 changes: 74 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
parameters:
jabba:
version: &jabba_version 0.9.2
cache_key: &jabba_cache_key v1-jabba-0.9.2
java:
version: &java_version zulu@1.9.0
yarn:
cache_key: &yarn_cache_key v1-yarn-{{ checksum "package.json" }}
docker:
image: &docker_image circleci/node:9
version: 2
workflows:
version: 2
build:
jobs:
- build:
context: npm
jobs:
build:
docker:
- image: *docker_image
working_directory: /tmp/workspace
environment:
JABBA_VERSION: *jabba_version
JAVA_VERSION: *java_version
steps:
- checkout
- restore_cache:
key: *jabba_cache_key
- run:
name: 'Setup: Jabba & Java Installation'
command: |
set -euxo pipefail
sudo ln -sf ~/.jabba/bin/jabba /usr/local/bin/jabba
[ ! -d ~/.jabba ] || exit 0
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh
jabba install $JAVA_VERSION
- save_cache:
key: *jabba_cache_key
paths:
- ~/.jabba
- restore_cache:
key: *yarn_cache_key
- run:
name: 'Setup: Dependency Installation'
command: yarn
- save_cache:
key: *yarn_cache_key
paths:
- node_modules
- run:
name: Lint
command: npx tslint --project .
when: always
- run:
name: Compilation
command: npm run compile
- run:
name: Test
command: npm run test
- run:
name: Coverage Publication
command: 'npm run coverage:publish'
- run:
name: Report
command: |
export JAVA_HOME="$(jabba which $JAVA_VERSION)"
npm run report
- store_artifacts:
path: report
when: always
- store_test_results:
path: report
when: always
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
"dist"
],
"scripts": {
"compile": "tsc",
"test": "nyc mocha",
"report": "allure generate -o report/allure -- metadata/allure"
"report": "allure generate -o report/allure -- metadata/allure",
"coverage:publish": "cat report/coverage/lcov.info | coveralls"
},
"devDependencies": {
"@types/chai": "^4.1.2",
"@types/mocha": "^2.2.48",
"@types/sinon": "^4.3.0",
"allure-commandline": "^2.5.0",
"chai": "^4.1.2",
"coveralls": "^3.0.0",
"mocha": "^5.0.4",
"mocha-allure-reporter": "^1.3.2",
"mocha-junit-reporter": "^1.17.0",
Expand Down

0 comments on commit fa1665d

Please sign in to comment.