This repository was archived by the owner on Mar 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 changed file
with
117 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Javascript Node CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | ||
# | ||
version: 2 | ||
|
||
# | ||
# YAML variable templates | ||
# | ||
job_defaults: &job_defaults | ||
working_directory: ~/fetch-browser | ||
docker: | ||
- image: circleci/node:lts | ||
|
||
job_filter: &job_filter | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
|
||
# | ||
# Run all jobs in sequence | ||
# | ||
workflows: | ||
version: 2 | ||
deploy_npm: | ||
jobs: | ||
- setup: | ||
<<: *job_filter | ||
- test: | ||
<<: *job_filter | ||
requires: | ||
- setup | ||
- coverage: | ||
<<: *job_filter | ||
requires: | ||
- test | ||
- publish: | ||
<<: *job_filter | ||
requires: | ||
- coverage | ||
|
||
# | ||
# Define atomic jobs | ||
# | ||
jobs: | ||
setup: | ||
<<: *job_defaults | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: "fetch-browser: Install npm packages" | ||
command: "npm run setup:ci" | ||
|
||
- run: | ||
name: "fetch-browser: Babel build" | ||
command: "npm run build" | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
- src | ||
- dist | ||
- tests | ||
- .git | ||
- .babelrc | ||
- .eslintrc | ||
- .gitignore | ||
- .prettierrc | ||
- README.md | ||
- CHANGELOG.md | ||
- package-lock.json | ||
- package.json | ||
key: fetch-browser-{{ .Branch }}-{{ .Revision }} | ||
|
||
test: | ||
<<: *job_defaults | ||
|
||
steps: | ||
- restore_cache: | ||
keys: | ||
- fetch-browser-{{ .Branch }}-{{ .Revision }} | ||
|
||
- run: | ||
name: "fetch-browser: Run linter" | ||
command: "npm run lint" | ||
|
||
# - run: | ||
# name: "fetch-browser: Run tests" | ||
# command: "npm run test" | ||
|
||
coverage: | ||
<<: *job_defaults | ||
|
||
steps: | ||
- restore_cache: | ||
keys: | ||
- fetch-browser-{{ .Branch }}-{{ .Revision }} | ||
|
||
# - run: | ||
# name: "fetch-browser: Publish test coverage to COVERALLS" | ||
# command: "npm run coverage:ci" | ||
|
||
publish: | ||
<<: *job_defaults | ||
|
||
steps: | ||
- restore_cache: | ||
keys: | ||
- fetch-browser-{{ .Branch }}-{{ .Revision }} | ||
|
||
- run: | ||
name: "fetch-browser: Release to npm with semantic-release" | ||
command: "npx semantic-release" | ||
|