forked from decentralized-identity/ethr-did-resolver
-
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.
Merge pull request decentralized-identity#40 from decentralized-ident…
…ity/fix/build-automation ci: update ci configs
- Loading branch information
Showing
8 changed files
with
13,766 additions
and
6,864 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,37 +1,127 @@ | ||
version: 2 | ||
############################################################### | ||
# References | ||
############################################################### | ||
version: 2.1 | ||
references: | ||
restore-npm-cache: &restore-npm-cache | ||
restore_cache: | ||
keys: | ||
# when lock file changes, use increasingly general patterns to restore cache | ||
- npm-packages-v1-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }} | ||
- npm-packages-v1-{{ checksum "package.json" }} | ||
- npm-packages-v1- | ||
|
||
save-npm-cache: &save-npm-cache | ||
save_cache: | ||
paths: | ||
- node_modules/ | ||
key: npm-packages-v1-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }} | ||
|
||
############################################################### | ||
# Workflows | ||
############################################################### | ||
workflows: | ||
# Trigger workflow for last commit (merge commits) to master | ||
# Run unit tests for sanity and if all looks good run semantic release | ||
# Semantic release will decide based on commit messages if another release is needed | ||
# Always run unit tests on master | ||
automatic-semantic-release: | ||
jobs: | ||
- verify-unit-tests: | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- run-semantic-release: | ||
requires: | ||
- verify-unit-tests | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
tags: | ||
# Would be good if we can ignore tagged commits but it won't trigger another build so it's fine | ||
ignore: /.*/ | ||
|
||
# This gets triggers on every push to all branches except master | ||
# It verifies the branch, runs unit tests and coverage | ||
verify-test-build: | ||
jobs: | ||
- verify-unit-tests: | ||
filters: | ||
branches: | ||
ignore: | ||
- master | ||
|
||
deploy-release-tag: | ||
jobs: | ||
- verify-unit-tests: | ||
filters: | ||
tags: | ||
only: /^v?((\d+\.))?(\d+\.)(\d+)-(dev|alpha|beta).*/ | ||
branches: | ||
ignore: /.*/ | ||
- deploy-to-npm: | ||
requires: | ||
- verify-unit-tests | ||
filters: | ||
tags: | ||
only: /^v?((\d+\.))?(\d+\.)(\d+)-(dev|alpha|beta).*/ | ||
branches: | ||
ignore: /.*/ | ||
|
||
############################################################### | ||
# Jobs | ||
############################################################### | ||
|
||
jobs: | ||
build: | ||
working_directory: ~/repo | ||
verify-unit-tests: | ||
working_directory: ~/project | ||
docker: | ||
- image: circleci/node:8 | ||
- image: circleci/node:10 | ||
steps: | ||
- checkout | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- dependencies-cache-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }} | ||
|
||
- *restore-npm-cache | ||
- run: | ||
name: install-dependencies | ||
command: | | ||
sudo npm i -g codecov node-gyp | ||
npm install | ||
name: Install node modules | ||
command: npm install | ||
- *save-npm-cache | ||
- run: | ||
name: test | ||
command: npm run test && codecov | ||
|
||
name: Run unit tests | ||
command: npm run test-with-coverage | ||
- run: | ||
name: code-coverage | ||
command: bash <(curl -s https://codecov.io/bash) | ||
|
||
- save_cache: | ||
key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }} | ||
name: Run lint | ||
command: npm run lint | ||
- persist_to_workspace: | ||
root: ~/project | ||
paths: | ||
- ./node_modules | ||
- node_modules | ||
|
||
workflows: | ||
version: 2 | ||
build-and-test: | ||
jobs: | ||
- build | ||
run-semantic-release: | ||
working_directory: ~/project | ||
docker: | ||
- image: circleci/node:10 | ||
steps: | ||
- checkout: | ||
path: ~/project | ||
- attach_workspace: | ||
at: ~/project | ||
- run: | ||
name: Semantic release | ||
command: | | ||
git config user.email "devops@uport.me" | ||
git config user.name "uport-automation-bot" | ||
npm run release | ||
deploy-to-npm: | ||
working_directory: ~/project | ||
docker: | ||
- image: circleci/node:10 | ||
steps: | ||
- checkout: | ||
path: ~/project | ||
- attach_workspace: | ||
at: ~/project | ||
- run: | ||
name: publish to npm | ||
command: npm publish |
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,9 @@ | ||
version: 1 | ||
update_configs: | ||
|
||
- package_manager: "javascript" | ||
directory: "/" | ||
update_schedule: "live" | ||
commit_message: | ||
prefix: "chore" | ||
include_scope: true |
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,17 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 30 | ||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 7 | ||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
# Label to use when marking an issue as stale | ||
staleLabel: inactive-autoclose | ||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false |
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,14 @@ | ||
{ | ||
"tagFormat": "${version}", | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
["@semantic-release/changelog", { | ||
"changelogFile": "CHANGELOG.md" | ||
}], | ||
"@semantic-release/npm", | ||
"@semantic-release/git", | ||
"@semantic-release/github" | ||
], | ||
"branch": "master" | ||
} |
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 |
---|---|---|
|
@@ -10,4 +10,4 @@ module.exports = { | |
} | ||
] | ||
] | ||
}; | ||
} |
Oops, something went wrong.