.circleci/config.yml
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
references:
workspace_root: &workspace_root ~/repo
defaults: &defaults
working_directory: *workspace_root
docker:
- image: auth0extensions/ci-node:extensions
jobs:
build_and_test:
<<: *defaults
environment:
CC_TEST_REPORTER_ID: 707f5959816d898ffc7176d49d2cd4f6b200c697460965a77d7af28ffdcf5cb6
steps:
- checkout
- restore_cache:
keys:
- npm-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- npm-dependencies-
- run:
name: Install FOSSA
command: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash
- run: npm install
# - run:
# name: FOSSA Init
# command: fossa init
# - run:
# name: FOSSA Analyze
# command: fossa analyze
# - run:
# name: FOSSA Test
# command: fossa test
# code climate requires before-build and after-build to be executed around test
- run:
name: Run Tests
command: |
#./cc-test-reporter before-build
npm run test
#./cc-test-reporter after-build --exit-code $?
- run:
name: Build and Package
command: |
npm run build
npm run package
- store_artifacts:
path: ./dist/package.zip
- save_cache:
name: Save npm packages to cache
key: npm-dependencies-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- persist_to_workspace:
root: *workspace_root
paths: .
workflows:
version: 2
build_and_test:
jobs:
- build_and_test