-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding CodeCov Integration to Track Code Coverage (#12)
- Loading branch information
Showing
4 changed files
with
17 additions
and
34 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 |
---|---|---|
|
@@ -2,36 +2,32 @@ version: 2.1 | |
|
||
orbs: | ||
node: circleci/[email protected] | ||
codecov: codecov/[email protected] | ||
|
||
defaults: &defaults | ||
working_directory: ~/repo | ||
docker: | ||
- image: cimg/node:18.15.0 | ||
|
||
jobs: | ||
test: | ||
test and coverage: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- node/install-packages: | ||
pkg-manager: yarn | ||
- run: yarn build | ||
- run: yarn lint | ||
- run: yarn test # Validate Unit Tests Pass | ||
- persist_to_workspace: | ||
root: ~/repo | ||
paths: . | ||
coverage: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/repo | ||
- run: | ||
name: Code Coverage Report | ||
command: yarn coverage | ||
- run: | ||
name: Validate Code Coverage Threshold | ||
command: yarn check-coverage #Validate code is adequately covered by unit tests | ||
- codecov/upload | ||
- persist_to_workspace: | ||
root: ~/repo | ||
paths: . | ||
publish: | ||
<<: *defaults | ||
steps: | ||
|
@@ -44,34 +40,21 @@ workflows: | |
version: 2 | ||
build: | ||
jobs: | ||
- test: | ||
filters: | ||
branches: | ||
ignore: | ||
- development | ||
- coverage: | ||
requires: | ||
- test | ||
- test and coverage: | ||
filters: | ||
branches: | ||
ignore: | ||
- development | ||
development: | ||
jobs: | ||
- test: | ||
- test and coverage: | ||
filters: | ||
&filters-development # this yaml anchor is setting these values to "filters-production" | ||
branches: | ||
only: development | ||
- coverage: | ||
requires: | ||
- test | ||
filters: | ||
<<: *filters-development # this is calling the previously set yaml anchor | ||
- publish: | ||
context: CPT | ||
requires: | ||
- test | ||
- coverage | ||
- test and coverage | ||
filters: | ||
<<: *filters-development # this is calling the previously set yaml anchor |
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