-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,85 @@ | ||
version: 2.1 | ||
job_configuration: &job_configuration | ||
docker: | ||
- image: circleci/node:10-stretch | ||
working_directory: ~/repo | ||
jobs: | ||
build-and-test: | ||
<<: *job_configuration | ||
resource_class: xlarge | ||
|
||
orbs: | ||
node: circleci/[email protected] | ||
|
||
executors: | ||
node-executor: | ||
docker: | ||
- image: circleci/node:13-buster | ||
working_directory: ~/repo | ||
|
||
commands: | ||
prepare-repository: | ||
description: Convenience command to checkout the repository and install dependencies | ||
steps: | ||
- checkout | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v3-dependencies-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v3-dependencies- | ||
|
||
- run: yarn install --frozen-lockfile | ||
|
||
- v3-dependencies | ||
- run: | ||
name: Install dependencies | ||
command: yarn install --frozen-lockfile | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v3-dependencies-{{ checksum "package.json" }} | ||
|
||
- run: | ||
name: Run tests | ||
command: yarn test | ||
|
||
- run: | ||
name: Compile | ||
command: yarn pack | ||
|
||
- run: ./bin/run --version | ||
|
||
- run: ./bin/run --help | ||
|
||
lint-check: | ||
<<: *job_configuration | ||
jobs: | ||
test: | ||
executor: node-executor | ||
resource_class: xlarge | ||
parallelism: 8 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: yarn install | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
- run: yarn lint:check | ||
- prepare-repository | ||
- node/with-splitting: | ||
glob-path: lib/**/*.spec.ts | ||
timings-type: classname | ||
steps: | ||
- run: | ||
name: Run tests | ||
command: yarn ci:test $TESTFILES | ||
environment: | ||
JEST_JUNIT_OUTPUT_DIR: ./test-reports/jest | ||
JEST_JUNIT_OUTPUT_NAME: results.xml | ||
JEST_JUNIT_CLASSNAME: "{filepath}" | ||
- store_test_results: | ||
path: ./test-reports | ||
|
||
validate-contracts: | ||
<<: *job_configuration | ||
lint-check: | ||
executor: node-executor | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: yarn install | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
- run: yarn build | ||
- run: ./bin/run validate ./lib/src/validation-server/spots/api.ts | ||
- prepare-repository | ||
- run: | ||
name: Run lint checker | ||
command: yarn lint:check | ||
|
||
publish: | ||
<<: *job_configuration | ||
executor: node-executor | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: yarn install | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
- prepare-repository | ||
- run: | ||
name: Authenticate with registry | ||
name: Authenticate with NPM registry | ||
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc | ||
- run: | ||
- deploy: | ||
name: Publish | ||
command: | | ||
npm publish --access=public | ||
command: npm publish --access=public | ||
|
||
workflows: | ||
build-and-test: | ||
jobs: | ||
- build-and-test: | ||
- test: | ||
filters: | ||
tags: | ||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ | ||
- lint-check: | ||
filters: | ||
tags: | ||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ | ||
- validate-contracts: | ||
filters: | ||
tags: | ||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ | ||
- publish: | ||
requires: | ||
- build-and-test | ||
- test | ||
- lint-check | ||
filters: | ||
tags: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
reporters: ["default", "jest-junit"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
testMatch: ["**/?(*.)+(spec).ts"] | ||
testMatch: ["**/?(*.)+(spec).ts"], | ||
testPathIgnorePatterns: ["<rootDir>/node_modules/"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4227,6 +4227,17 @@ jest-jasmine2@^24.9.0: | |
pretty-format "^24.9.0" | ||
throat "^4.0.0" | ||
|
||
jest-junit@^10.0.0: | ||
version "10.0.0" | ||
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-10.0.0.tgz#c94b91c24920a327c9d2a075e897b2dba4af494b" | ||
integrity sha512-dbOVRyxHprdSpwSAR9/YshLwmnwf+RSl5hf0kCGlhAcEeZY9aRqo4oNmaT0tLC16Zy9D0zekDjWkjHGjXlglaQ== | ||
dependencies: | ||
jest-validate "^24.9.0" | ||
mkdirp "^0.5.1" | ||
strip-ansi "^5.2.0" | ||
uuid "^3.3.3" | ||
xml "^1.0.1" | ||
|
||
jest-leak-detector@^24.9.0: | ||
version "24.9.0" | ||
resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz#b665dea7c77100c5c4f7dfcb153b65cf07dcf96a" | ||
|
@@ -7622,6 +7633,11 @@ uuid@^3.3.2: | |
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" | ||
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== | ||
|
||
uuid@^3.3.3: | ||
version "3.4.0" | ||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" | ||
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== | ||
|
||
[email protected]: | ||
version "2.0.3" | ||
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" | ||
|
@@ -7885,6 +7901,11 @@ xml-name-validator@^3.0.0: | |
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" | ||
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== | ||
|
||
xml@^1.0.1: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" | ||
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU= | ||
|
||
[email protected]: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" | ||
|