add linting and security checking for gitlab ci
This commit is contained in:
@@ -7,33 +7,25 @@ workflow:
|
||||
- if: $CI_PIPELINE_TAG
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- deploy
|
||||
- security
|
||||
- lint
|
||||
|
||||
build-job:
|
||||
stage: build
|
||||
script:
|
||||
- echo "Compiling the code..."
|
||||
- echo "Compile complete."
|
||||
include:
|
||||
- template: Security/SAST.gitlab-ci.yml
|
||||
- template: Security/DAST.gitlab-ci.yml
|
||||
|
||||
unit-test-job:
|
||||
stage: test
|
||||
script:
|
||||
- echo "Running unit tests... This will take about 60 seconds."
|
||||
- sleep 60
|
||||
- echo "Code coverage is 90%"
|
||||
sast:
|
||||
stage: security
|
||||
|
||||
lint-test-job:
|
||||
stage: test
|
||||
script:
|
||||
- echo "Linting code... This will take about 10 seconds."
|
||||
- sleep 10
|
||||
- echo "No lint issues found."
|
||||
dast:
|
||||
stage: security
|
||||
|
||||
deploy-job:
|
||||
stage: deploy
|
||||
environment: production
|
||||
markdown_lint:
|
||||
stage: lint
|
||||
image: ghcr.io/igorshubovych/markdownlint-cli:latest
|
||||
allow_failures: true
|
||||
rules:
|
||||
- changes:
|
||||
- "**/*.md"
|
||||
script:
|
||||
- echo "Deploying application..."
|
||||
- echo "Application successfully deployed."
|
||||
- markdownlint "**/*.md"
|
||||
Reference in New Issue
Block a user