Skip to content

Commit

Permalink
[#82] chore: update circleci configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Aug 8, 2021
1 parent d328cf4 commit 9bd89df
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 49 deletions.
100 changes: 51 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orbs:
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:12.18.3
- image: circleci/node:15.14

jobs:
build:
Expand All @@ -16,18 +16,18 @@ jobs:

- run:
name: Install Codecov
command: npm install codecov
command: yarn add codecov

- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found.
- v1-dependencies-

- run: npm install
- run: yarn install
- run:
name: Build component
command: npm run build
command: yarn && yarn build

- save_cache:
paths:
Expand All @@ -39,23 +39,24 @@ jobs:
paths:
- .

build_docs:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
# TODO - Fix CI Docs build.
# build_docs:
# <<: *defaults
# steps:
# - attach_workspace:
# at: ~/repo

- run:
name: Build with DruxtJS Docgen
command: npm run docs:build
# - run:
# name: Build with DruxtJS Docgen
# command: npm run docs:build

- store_artifacts:
path: ~/repo/docs/.vuepress/dist
# - store_artifacts:
# path: ~/repo/docs/.vuepress/dist

- persist_to_workspace:
root: ~/repo
paths:
- .
# - persist_to_workspace:
# root: ~/repo
# paths:
# - .

test:
<<: *defaults
Expand All @@ -65,58 +66,59 @@ jobs:

- run:
name: Run tests
command: npm test -- --reporters=jest-junit
command: yarn test --reporters=jest-junit
environment:
JEST_JUNIT_OUTPUT_DIR: ./reports/junit/

- run:
name: Upload coverage report
command: npx codecov
command: yarn dlx codecov

- store_test_results:
path: ./reports/junit/

- store_artifacts:
path: ./reports/junit

deploy:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
# TODO - Fix CI deploy
# deploy:
# <<: *defaults
# steps:
# - attach_workspace:
# at: ~/repo

- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
# - run:
# name: Authenticate with registry
# command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc

- run:
name: Publish package
command: npm publish
# - run:
# name: Publish package
# command: npm publish

workflows:
version: 2

test_deploy:
jobs:
- build
- build_docs:
requires:
- build
# - build_docs:
# requires:
# - build
- test:
requires:
- build
- deploy:
requires:
- build
- test
filters:
branches:
only: master
- gh-pages/deploy:
build-dir: ../repo/docs/.vuepress/dist
requires:
- build_docs
ssh-fingerprints: "c9:f9:e5:7d:4f:b2:5e:1e:f1:9a:5e:eb:47:91:10:b8"
filters:
branches:
only: master
# - deploy:
# requires:
# - build
# - test
# filters:
# branches:
# only: master
# - gh-pages/deploy:
# build-dir: ../repo/docs/.vuepress/dist
# requires:
# - build_docs
# ssh-fingerprints: "c9:f9:e5:7d:4f:b2:5e:1e:f1:9a:5e:eb:47:91:10:b8"
# filters:
# branches:
# only: master
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"eslint": "^7.31.0",
"eslint-plugin-nuxt": "^2.0.0",
"jest": "^27.0.6",
"jest-junit": "^12.2.0",
"jest-mock-axios": "^4.4.0",
"regenerator-runtime": "^0.13.9",
"rimraf": "^3.0.2",
Expand Down
45 changes: 45 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,13 @@ __metadata:
languageName: node
linkType: hard

"ansi-regex@npm:^4.1.0":
version: 4.1.0
resolution: "ansi-regex@npm:4.1.0"
checksum: 97aa4659538d53e5e441f5ef2949a3cffcb838e57aeaad42c4194e9d7ddb37246a6526c4ca85d3940a9d1e19b11cc2e114530b54c9d700c8baf163c31779baf8
languageName: node
linkType: hard

"ansi-regex@npm:^5.0.0":
version: 5.0.0
resolution: "ansi-regex@npm:5.0.0"
Expand Down Expand Up @@ -3446,6 +3453,7 @@ __metadata:
eslint: ^7.31.0
eslint-plugin-nuxt: ^2.0.0
jest: ^27.0.6
jest-junit: ^12.2.0
jest-mock-axios: ^4.4.0
regenerator-runtime: ^0.13.9
rimraf: ^3.0.2
Expand Down Expand Up @@ -5203,6 +5211,18 @@ __metadata:
languageName: node
linkType: hard

"jest-junit@npm:^12.2.0":
version: 12.2.0
resolution: "jest-junit@npm:12.2.0"
dependencies:
mkdirp: ^1.0.4
strip-ansi: ^5.2.0
uuid: ^8.3.2
xml: ^1.0.1
checksum: 6a666b017eac77fd549a64ec68fda858d078e016405318684361392eac4c4d189a42f8dd9d9d1266ceab2245b1d9c7c63ea76827cd6429705ccdc1675b049d7d
languageName: node
linkType: hard

"jest-leak-detector@npm:^27.0.6":
version: 27.0.6
resolution: "jest-leak-detector@npm:27.0.6"
Expand Down Expand Up @@ -7499,6 +7519,15 @@ __metadata:
languageName: node
linkType: hard

"strip-ansi@npm:^5.2.0":
version: 5.2.0
resolution: "strip-ansi@npm:5.2.0"
dependencies:
ansi-regex: ^4.1.0
checksum: bdb5f76ade97062bd88e7723aa019adbfacdcba42223b19ccb528ffb9fb0b89a5be442c663c4a3fb25268eaa3f6ea19c7c3fbae830bd1562d55adccae1fcec46
languageName: node
linkType: hard

"strip-ansi@npm:^6.0.0":
version: 6.0.0
resolution: "strip-ansi@npm:6.0.0"
Expand Down Expand Up @@ -7964,6 +7993,15 @@ typescript@^4.3.5:
languageName: node
linkType: hard

"uuid@npm:^8.3.2":
version: 8.3.2
resolution: "uuid@npm:8.3.2"
bin:
uuid: dist/bin/uuid
checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df
languageName: node
linkType: hard

"v8-compile-cache@npm:^2.0.3, v8-compile-cache@npm:^2.3.0":
version: 2.3.0
resolution: "v8-compile-cache@npm:2.3.0"
Expand Down Expand Up @@ -8213,6 +8251,13 @@ typescript@^4.3.5:
languageName: node
linkType: hard

"xml@npm:^1.0.1":
version: 1.0.1
resolution: "xml@npm:1.0.1"
checksum: 11b5545ef3f8fec3fa29ce251f50ad7b6c97c103ed4d851306ec23366f5fa4699dd6a942262df52313a0cd1840ab26256da253c023bad3309d8ce46fe6020ca0
languageName: node
linkType: hard

"xmlchars@npm:^2.2.0":
version: 2.2.0
resolution: "xmlchars@npm:2.2.0"
Expand Down

0 comments on commit 9bd89df

Please sign in to comment.