2022-07-17 16:25:56 +00:00
|
|
|
variables:
|
2022-10-25 12:51:29 +00:00
|
|
|
- &node_image 'node:18-alpine'
|
2022-07-17 16:25:56 +00:00
|
|
|
- &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/**"
|
|
|
|
|
2023-06-07 10:04:37 +00:00
|
|
|
pipeline: &legacy
|
2021-11-30 16:46:19 +00:00
|
|
|
deps:
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *node_image
|
2022-10-25 12:51:29 +00:00
|
|
|
directory: web/
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
2022-10-08 14:15:07 +00:00
|
|
|
- corepack enable
|
|
|
|
- pnpm install --frozen-lockfile
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
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
|
2022-10-25 12:51:29 +00:00
|
|
|
directory: web/
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
2022-10-08 14:15:07 +00:00
|
|
|
- corepack enable
|
|
|
|
- pnpm lint
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
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
|
2022-10-25 12:51:29 +00:00
|
|
|
directory: web/
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
2022-10-08 14:15:07 +00:00
|
|
|
- corepack enable
|
|
|
|
- pnpm formatcheck
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
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
|
2022-10-25 12:51:29 +00:00
|
|
|
directory: web/
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
2022-10-08 14:15:07 +00:00
|
|
|
- corepack enable
|
|
|
|
- pnpm typecheck
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
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/
|
2023-06-29 15:09:33 +00:00
|
|
|
failure: ignore
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2022-09-03 18:46:48 +00:00
|
|
|
|
2021-11-30 16:46:19 +00:00
|
|
|
test:
|
|
|
|
group: test
|
2022-07-17 16:25:56 +00:00
|
|
|
image: *node_image
|
2022-10-25 12:51:29 +00:00
|
|
|
directory: web/
|
2021-11-30 16:46:19 +00:00
|
|
|
commands:
|
2022-10-08 14:15:07 +00:00
|
|
|
- corepack enable
|
|
|
|
- pnpm test
|
2022-10-14 11:38:03 +00:00
|
|
|
when:
|
|
|
|
path: *when_path
|
2023-06-07 10:04:37 +00:00
|
|
|
|
|
|
|
steps: *legacy
|