2022-07-17 18:25:56 +02:00
|
|
|
variables:
|
2022-10-25 14:51:29 +02:00
|
|
|
- &node_image 'node:18-alpine'
|
2022-07-17 18:25:56 +02:00
|
|
|
- &when_path
|
2022-09-03 21:46:48 +03:00
|
|
|
# related config files
|
|
|
|
- ".woodpecker/web.yml"
|
2022-07-17 18:25:56 +02:00
|
|
|
# web source code
|
|
|
|
- "web/**"
|
|
|
|
|
2021-11-30 17:46:19 +01:00
|
|
|
pipeline:
|
|
|
|
deps:
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2022-10-25 14:51:29 +02:00
|
|
|
directory: web/
|
2021-11-30 17:46:19 +01:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm install --frozen-lockfile
|
2022-10-14 13:38:03 +02:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2021-11-30 17:46:19 +01:00
|
|
|
|
|
|
|
lint:
|
|
|
|
group: test
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2022-10-25 14:51:29 +02:00
|
|
|
directory: web/
|
2021-11-30 17:46:19 +01:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm lint
|
2022-10-14 13:38:03 +02:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2021-11-30 17:46:19 +01:00
|
|
|
|
|
|
|
formatcheck:
|
|
|
|
group: test
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2022-10-25 14:51:29 +02:00
|
|
|
directory: web/
|
2021-11-30 17:46:19 +01:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm formatcheck
|
2022-10-14 13:38:03 +02:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2021-11-30 17:46:19 +01:00
|
|
|
|
|
|
|
typecheck:
|
|
|
|
group: test
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2022-10-25 14:51:29 +02:00
|
|
|
directory: web/
|
2021-11-30 17:46:19 +01:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm typecheck
|
2022-10-14 13:38:03 +02:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2021-11-30 17:46:19 +01:00
|
|
|
|
2022-09-03 21:46:48 +03: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/
|
2022-10-14 13:38:03 +02:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-09-03 21:46:48 +03:00
|
|
|
|
2021-11-30 17:46:19 +01:00
|
|
|
test:
|
|
|
|
group: test
|
2022-07-17 18:25:56 +02:00
|
|
|
image: *node_image
|
2022-10-25 14:51:29 +02:00
|
|
|
directory: web/
|
2021-11-30 17:46:19 +01:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm test
|
2022-10-14 13:38:03 +02:00
|
|
|
when:
|
|
|
|
path: *when_path
|