Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 34 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ defaults_Dependencies: &defaults_Dependencies |
apk --no-cache add openssh-client
apk --no-cache add bash
apk add --no-cache -t build-dependencies make gcc g++ python libtool autoconf automake
npm config set unsafe-perm true
npm install -g node-gyp
apk --no-cache add librdkafka-dev

defaults_awsCliDependencies: &defaults_awsCliDependencies |
apk --no-cache add \
Expand Down Expand Up @@ -64,6 +63,16 @@ defaults_slack_announcement: &defaults_slack_announcement
\"text\": \"*${CIRCLE_PROJECT_REPONAME}* - Release \`${CIRCLE_TAG}\`: https://github.com/mojaloop/${CIRCLE_PROJECT_REPONAME}/releases/tag/${CIRCLE_TAG}\"
}"

defaults_display_versions: &defaults_display_versions
name: Display Versions
command: |
echo "What is the active version of Nodejs?"
echo "node: $(node --version)"
echo "yarn: $(yarn --version)"
echo "npm: $(npm --version)"
echo "nvm: $(nvm --version)"


jobs:
setup:
<<: *defaults_working_directory
Expand All @@ -73,6 +82,8 @@ jobs:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- run:
<<: *defaults_display_versions
- run:
name: Update NPM install
command: npm install
Expand All @@ -89,6 +100,8 @@ jobs:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- run:
<<: *defaults_display_versions
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
Expand All @@ -102,7 +115,7 @@ jobs:
command: npm -s run test:xunit > ./test/results/tape.xml
- store_artifacts:
path: ./test/results
prefix: test
destination: test
- store_test_results:
path: ./test/results

Expand All @@ -117,25 +130,27 @@ jobs:
name: Install AWS CLI dependencies
command: *defaults_awsCliDependencies
- checkout
- run:
<<: *defaults_display_versions
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Execute code coverage check
command: npm -s run test:coverage-check
- store_artifacts:
path: coverage
prefix: test
destination: test
- store_test_results:
path: coverage/lcov.info
- run:
name: Copy code coverage to SonarQube
command: |
if [ "${CIRCLE_BRANCH}" == "master" ];
if [ "${CIRCLE_BRANCH}" == "main" ];
then
echo "Sending lcov.info to SonarQube..."
aws s3 cp coverage/lcov.info $AWS_S3_DIR_SONARQUBE/$CIRCLE_PROJECT_REPONAME/lcov.info
else
echo "Not a release (env CIRCLE_BRANCH != 'master'), skipping sending lcov.info to SonarQube."
echo "Not a release (env CIRCLE_BRANCH != 'main'), skipping sending lcov.info to SonarQube."
fi

vulnerability-check:
Expand All @@ -146,17 +161,19 @@ jobs:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- run:
<<: *defaults_display_versions
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Create dir for test results
command: mkdir -p ./audit/results
- run:
name: Check for new npm vulnerabilities
command: npm run audit:check --silent -- --json > ./audit/results/auditResults.json
command: npm run audit:check -- -o json > ./audit/results/auditResults.json
- store_artifacts:
path: ./audit/results
prefix: audit
destination: audit

audit-licenses:
<<: *defaults_working_directory
Expand All @@ -168,14 +185,16 @@ jobs:
- run:
<<: *defaults_license_scanner
- checkout
- run:
<<: *defaults_display_versions
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Run the license-scanner
command: cd /tmp/license-scanner && pathToRepo=$CIRCLE_WORKING_DIRECTORY make run
- store_artifacts:
path: /tmp/license-scanner/results
prefix: licenses
destination: licenses

build-snapshot:
<<: *defaults_working_directory
Expand All @@ -185,6 +204,8 @@ jobs:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- run:
<<: *defaults_display_versions
- run:
name: setup environment vars for SNAPSHOT release
command: |
Expand All @@ -196,14 +217,16 @@ jobs:
- run:
<<: *defaults_slack_announcement

build:
build-local:
<<: *defaults_working_directory
<<: *defaults_docker_node
steps:
- run:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- run:
<<: *defaults_display_versions
- run:
name: setup environment vars for LATEST release
command: |
Expand Down Expand Up @@ -286,7 +309,7 @@ workflows:
branches:
ignore:
- /.*/
- build:
- build-local:
context: org-global
requires:
- setup
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.17.1
15 changes: 15 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"types": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "docs", "section": "Documentation"},
{"type": "style", "section": "Styling"},
{"type": "refactor", "section": "Refactors"},
{"type": "perf", "section": "Performance"},
{"type": "test", "section": "Tests"},
{"type": "build", "section": "Build System"},
{"type": "ci", "section": "CI"},
{"type": "chore", "section": "Chore"},
{"type": "revert", "section": "Reverts"}
]
}
Empty file added audit-ci.jsonc
Empty file.
Loading