From a4bd846eefbe854e0b2a83adc80d2b4ab3aeedd5 Mon Sep 17 00:00:00 2001 From: Dmytro Pustovit Date: Mon, 11 Oct 2021 23:19:24 +0300 Subject: [PATCH] Chore: test-security in separete ci job --- .circleci/config.yml | 39 ++++++++++++++++++++++++++++++++++----- package.json | 4 ++-- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d21d2c8..483c65c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,22 @@ cache-defaults: &cache-defaults - -{{ checksum "package-lock.json" }} parameters: - env-tests: + skip-fossa: + type: boolean + default: false + skip-coveralls: + type: boolean + default: false + skip-security: + type: boolean + default: false + skip-leaks: + type: boolean + default: false + skip-deploy: + type: boolean + default: false + skip-danger: type: boolean default: false @@ -48,6 +63,9 @@ aliases: - &security name: Validate dependencies command: npm run test:security + - &security-all + name: Validate dev-dependencies + command: npm audit - &install name: Installing Dependencies command: npm ci @@ -79,6 +97,18 @@ jobs: - run: *danger-pr - run: *fossa-analize - save_cache: *cache-modules + test-security: + <<: *defaults + steps: + - checkout + - when: + condition: + not: << pipeline.parameters.skip-security >> + steps: + - restore_cache: + <<: *cache-defaults + - run: *security + - run: *security-all test-coverage: <<: *defaults steps: @@ -149,6 +179,9 @@ workflows: jobs: - install: context: branches + - test-security: + requires: + - install - test-package: requires: - install @@ -183,7 +216,3 @@ workflows: filters: branches: only: /pull\/[0-9]+/ - env-tests: - when: << pipeline.parameters.env-tests >> - jobs: - - install diff --git a/package.json b/package.json index 0e102a3..0d96f7f 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "scripts": { "prepare": "babel src --out-dir ./lib --copy-files && husky install", "coveralls": "cat ./reports/coverage/lcov.info | coveralls", - "test:security": "npm audit && npm run test:lock", + "test:security": "npm audit --production && npm run test:lock", "test:lint": "eslint src bin tests --no-error-on-unmatched-pattern", - "test:mocha": "mocha --config .mocharc.json 'tests/**/*test.js'", + "test:mocha": "mocha --config .mocharc.json 'tests/**/*test.js'", "test:package": "npt test -c .package-tester.json", "test:coverage": "BUILD=0 MODE=test nyc mocha --config .mocharc.json 'tests/**/*test.js'", "test:debt": "jscpd src --config .jscpd.json",