-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
4ec0565
commit 0e30904
Showing
1 changed file
with
24 additions
and
67 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,77 +1,34 @@ | ||
# This config was automatically generated from your source code | ||
# Stacks detected: cicd:github-actions:.github/workflows,cicd:gitlab-workflows:.,deps:node:. | ||
version: 2.1 | ||
orbs: | ||
node: circleci/node@5 | ||
snyk: snyk/[email protected] | ||
jobs: | ||
snyk_scan: | ||
docker: | ||
- image: cimg/node2:lts | ||
- image: cimg/node:lts | ||
steps: | ||
- checkout | ||
- run: npm ci | ||
- snyk/install | ||
- run: | ||
command: snyk version | ||
name: Which version of snyk is installed | ||
- run: | ||
command: snyk code test | ||
name: Run code scan | ||
test-node: | ||
# Install node dependencies and run tests | ||
executor: node/default | ||
steps: | ||
- checkout | ||
- node/install-packages: | ||
pkg-manager: npm | ||
- run: | ||
name: Run tests | ||
command: echo \"No test specified in package.json\" | ||
build-node: | ||
# Build node project | ||
executor: node/default | ||
steps: | ||
- checkout | ||
- node/install-packages: | ||
pkg-manager: npm | ||
- run: | ||
command: npm run build | ||
- run: | ||
name: Create the ~/artifacts directory if it doesn't exist | ||
command: mkdir -p ~/artifacts | ||
# Copy output to artifacts dir | ||
- run: | ||
name: Copy artifacts | ||
command: cp -R build dist public .output .next .docusaurus ~/artifacts 2>/dev/null || true | ||
- store_artifacts: | ||
path: ~/artifacts | ||
destination: node-build | ||
deploy: | ||
# This is an example deploy job, not actually used by the workflow | ||
docker: | ||
- image: cimg/base:stable | ||
steps: | ||
# Replace this with steps to deploy to users | ||
- run: | ||
name: deploy | ||
command: '#e.g. ./deploy.sh' | ||
- run: | ||
name: found github actions config | ||
command: ':' | ||
- run: | ||
name: found gitlab workflows config | ||
command: ':' | ||
name: Download Snyk CLI | ||
command: | | ||
curl -Lo snyk-linux https://static.snyk.io/cli/latest/snyk-linux | ||
- run: | ||
name: Download Snyk CLI SHA256 Checksum | ||
command: | | ||
curl -Lo snyk-linux.sha256 https://static.snyk.io/cli/latest/snyk-linux.sha256 | ||
- run: | ||
name: Verify SHA256 Checksum | ||
command: | | ||
sha256sum -c snyk-linux.sha256 | ||
- run: | ||
name: Install Snyk CLI | ||
command: | | ||
chmod +x snyk-linux | ||
./snyk-linux --version | ||
- run: | ||
name: Run Snyk to test project dependencies | ||
command: | | ||
./snyk-linux test | ||
workflows: | ||
build-and-test: | ||
version: 2 | ||
build_and_scan: | ||
jobs: | ||
- test-node | ||
- snyk_scan: | ||
requires: | ||
- test-node | ||
- build-node: | ||
requires: | ||
- test-node | ||
# - deploy: | ||
# requires: | ||
# - build-node | ||
- snyk_scan |