2022-07-17 18:25:56 +02:00
|
|
|
variables:
|
|
|
|
- &node_image 'node:16-alpine'
|
|
|
|
- &when_path
|
2022-09-03 20:46:48 +02:00
|
|
|
# related config files
|
|
|
|
- ".woodpecker/web.yml"
|
2022-07-17 18:25:56 +02:00
|
|
|
# web source code
|
|
|
|
- "web/**"
|
|
|
|
|
2021-11-30 18:46:19 +02:00
|
|
|
pipeline:
|
|
|
|
deps:
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2021-11-30 18:46:19 +02:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn install --frozen-lockfile
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2021-11-30 18:46:19 +02:00
|
|
|
|
|
|
|
lint:
|
|
|
|
group: test
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2021-11-30 18:46:19 +02:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn lint
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2021-11-30 18:46:19 +02:00
|
|
|
|
|
|
|
formatcheck:
|
|
|
|
group: test
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2021-11-30 18:46:19 +02:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn formatcheck
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2021-11-30 18:46:19 +02:00
|
|
|
|
|
|
|
typecheck:
|
|
|
|
group: test
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2021-11-30 18:46:19 +02:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn typecheck
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2021-11-30 18:46:19 +02:00
|
|
|
|
2022-09-03 20:46:48 +02: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 18:46:19 +02:00
|
|
|
test:
|
|
|
|
group: test
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2021-11-30 18:46:19 +02:00
|
|
|
commands:
|
|
|
|
- cd web/
|
|
|
|
- yarn test
|
2022-05-20 05:31:19 +02:00
|
|
|
when:
|
2022-07-17 18:25:56 +02:00
|
|
|
path: *when_path
|
2021-11-30 18:46:19 +02:00
|
|
|
|