2022-07-17 16:25:56 +00:00
|
|
|
variables:
|
|
|
|
- &node_image 'node:16-alpine'
|
|
|
|
- &when_path
|
2022-09-03 18:46:48 +00:00
|
|
|
# related config files
|
|
|
|
- ".woodpecker/web.yml"
|
2022-07-17 16:25:56 +00:00
|
|
|
# web source code
|
|
|
|
- "web/**"
|
|
|
|
|
2021-11-30 16:46:19 +00:00
|
|
|
pipeline:
|
|
|
|
deps:
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *node_image
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn install --frozen-lockfile
|
2022-05-20 03:31:19 +00:00
|
|
|
when:
|
2022-07-17 16:25:56 +00:00
|
|
|
path: *when_path
|
2021-11-30 16:46:19 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
group: test
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *node_image
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn lint
|
2022-05-20 03:31:19 +00:00
|
|
|
when:
|
2022-07-17 16:25:56 +00:00
|
|
|
path: *when_path
|
2021-11-30 16:46:19 +00:00
|
|
|
|
|
|
|
formatcheck:
|
|
|
|
group: test
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *node_image
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn formatcheck
|
2022-05-20 03:31:19 +00:00
|
|
|
when:
|
2022-07-17 16:25:56 +00:00
|
|
|
path: *when_path
|
2021-11-30 16:46:19 +00:00
|
|
|
|
|
|
|
typecheck:
|
|
|
|
group: test
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *node_image
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn typecheck
|
2022-05-20 03:31:19 +00:00
|
|
|
when:
|
2022-07-17 16:25:56 +00:00
|
|
|
path: *when_path
|
2021-11-30 16:46:19 +00:00
|
|
|
|
2022-09-03 18:46:48 +00:00
|
|
|
securitycheck:
|
|
|
|
group: test
|
|
|
|
image: aquasec/trivy:latest
|
|
|
|
commands:
|
|
|
|
- trivy fs --exit-code 0 --skip-dirs node_modules/ --severity UNKNOWN,LOW web/
|
|
|
|
- trivy fs --exit-code 1 --skip-dirs node_modules/ --severity MEDIUM,HIGH,CRITICAL web/
|
|
|
|
when:
|
|
|
|
path: *when_path
|
|
|
|
|
2021-11-30 16:46:19 +00:00
|
|
|
test:
|
|
|
|
group: test
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *node_image
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn test
|
2022-05-20 03:31:19 +00:00
|
|
|
when:
|
2022-07-17 16:25:56 +00:00
|
|
|
path: *when_path
|
2021-11-30 16:46:19 +00:00
|
|
|
|