Skip to content

Commit

Permalink
feat: configure CircleCI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 committed Aug 5, 2019
1 parent b1dc1a3 commit ab9573e
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 41 deletions.
104 changes: 78 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,88 @@
version: 2

unit_tests: &unit_tests
steps:
- checkout
- run:
name: Create Checksum
command: sh .circleci/checksum.sh /tmp/checksums.txt
- restore_cache:
keys:
- npm-cache-{{ checksum "/tmp/checksums.txt" }}
- run:
name: Install Dependencies
command: yarn install
- save_cache:
key: npm-cache-{{ checksum "/tmp/checksums.txt" }}
paths:
- ./node_modules
- ./yarn.lock
- ./packages/*/node_modules
- ./packages/*/yarn.lock
- run:
name: Compile code
command: yarn compile
- run:
name: Unit tests
command: yarn test:node
- run:
name: report coverage
command: yarn codecov

browsers_unit_tests: &browsers_unit_tests
steps:
- checkout
- run:
name: Install Dependencies
command: yarn install
- run:
name: Compile code
command: yarn compile
- run:
name: Unit tests
command: yarn test:browser

jobs:
build:
lint:
docker:
- image: circleci/node:12-browsers
- image: node
steps:
- checkout
- run:
name: Create Checksum
command: sh .circleci/checksum.sh /tmp/checksums.txt
- restore_cache:
keys:
- npm-cache-{{ checksum "/tmp/checksums.txt" }}
- run:
name: Install Dependencies
name: Install modules and dependencies.
command: yarn install
- save_cache:
key: npm-cache-{{ checksum "/tmp/checksums.txt" }}
paths:
- ./node_modules
- ./yarn.lock
- ./packages/*/node_modules
- ./packages/*/yarn.lock
- run:
name: Lint
name: Check code style and linting
command: yarn run check
- run:
name: Compile
command: yarn compile
- run:
name: Test
command: yarn test
- run:
name: report-coverage
command: yarn codecov
node8:
docker:
- image: node:8
<<: *unit_tests
node10:
docker:
- image: node:10
<<: *unit_tests
node11:
docker:
- image: node:11
<<: *unit_tests
node12:
docker:
- image: node:12
<<: *unit_tests
node12-browsers:
docker:
- image: circleci/node:12-browsers
<<: *browsers_unit_tests


workflows:
version: 2
build:
jobs:
- lint
- node8
- node10
- node11
- node12
- node12-browsers
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"fix": "lerna run fix",
"postinstall": "yarn run bootstrap",
"compile": "lerna run compile",
"test": "lerna run test",
"test:node": "lerna run test:node",
"test:browser": "lerna run test:browser",
"bootstrap": "lerna bootstrap",
"bump": "lerna publish",
"codecov": "lerna run codecov",
Expand Down
5 changes: 2 additions & 3 deletions packages/opentelemetry-basic-tracer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"test": "c8 ts-mocha -p tsconfig.json test/**/*.ts",
"test:node": "c8 ts-mocha -p tsconfig.json test/**/*.ts",
"tdd": "yarn test -- --watch-extensions ts --watch",
"codecov": "c8 report --reporter=json && codecov -f coverage/*.json -p ../../",
"clean": "rimraf build/*",
"check": "gts check",
"compile": "tsc -p .",
"fix": "gts fix",
"posttest": "yarn run check"
"fix": "gts fix"
},
"keywords": [
"opentelemetry",
Expand Down
3 changes: 1 addition & 2 deletions packages/opentelemetry-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"clean": "rimraf build/*",
"check": "gts check",
"compile": "tsc -p .",
"fix": "gts fix",
"posttest": "yarn run check"
"fix": "gts fix"
},
"keywords": [
"opentelemetry",
Expand Down
5 changes: 2 additions & 3 deletions packages/opentelemetry-node-tracer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"test": "c8 ts-mocha -p tsconfig.json test/**/*.ts",
"test:node": "c8 ts-mocha -p tsconfig.json test/**/*.ts",
"tdd": "yarn test -- --watch-extensions ts --watch",
"codecov": "c8 report --reporter=json && codecov -f coverage/*.json -p ../../",
"clean": "rimraf build/*",
"check": "gts check",
"compile": "tsc -p .",
"fix": "gts fix",
"posttest": "yarn run check"
"fix": "gts fix"
},
"keywords": [
"opentelemetry",
Expand Down
5 changes: 2 additions & 3 deletions packages/opentelemetry-scope-async-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"test": "c8 ts-mocha -p tsconfig.json test/**/*.ts",
"test:node": "c8 ts-mocha -p tsconfig.json test/**/*.ts",
"tdd": "yarn test -- --watch-extensions ts --watch",
"codecov": "c8 report --reporter=json && codecov -f coverage/*.json -p ../../",
"clean": "rimraf build/*",
"check": "gts check",
"compile": "tsc -p .",
"fix": "gts fix",
"posttest": "yarn run check"
"fix": "gts fix"
},
"keywords": [
"opentelemetry",
Expand Down
5 changes: 2 additions & 3 deletions packages/opentelemetry-scope-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"test": "c8 ts-mocha -p tsconfig.json test/**/*.ts",
"test:node": "c8 ts-mocha -p tsconfig.json test/**/*.ts",
"tdd": "yarn test -- --watch-extensions ts --watch",
"codecov": "c8 report --reporter=json && codecov -f coverage/*.json -p ../../",
"clean": "rimraf build/*",
"check": "gts check",
"compile": "tsc -p .",
"fix": "gts fix",
"posttest": "yarn run check"
"fix": "gts fix"
},
"keywords": [
"opentelemetry",
Expand Down

0 comments on commit ab9573e

Please sign in to comment.