Skip to content

Refactor CircleCI config #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
version: 2

defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node

jobs:
build:
docker:
- image: circleci/node
<<: *defaults
steps:
- checkout
- restore_cache:
key: deps-{{ checksum "package-lock.json" }}
- run:
command: npm install
- run:
command: npx tsc && npm test
command: npm install mocha-junit-reporter
- run:
command: npm run check-fmt
command: npx tsc
- save_cache:
key: deps-{{ checksum "package-lock.json" }}
paths:
- node_modules/
- persist_to_workspace:
root: ~/repo
paths: .
test:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
command: npx mocha --reporter mocha-junit-reporter
environment:
MOCHA_FILE: test-results/mocha/results.xml
- store_test_results:
path: test-results
- run:
command: npm run check-fmt

workflows:
version: 2
build-test:
jobs:
- build
- test:
requires:
- build
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"fmt": "npx prettier --write \"{lib,example,test}/**/*.{ts,js}\"",
"check-fmt": "npx prettier --list-different \"{lib,example,test}/**/*.{ts,js}\"",
"test": "npx mocha --reporter spec",
"test": "npx mocha",
"cover": "npx nyc --reporter html mocha"
},
"keywords": [
Expand Down