2023-07-12 23:25:05 +02:00
|
|
|
when:
|
2023-07-25 14:08:21 +02:00
|
|
|
- event: [pull_request, tag]
|
2023-07-12 23:25:05 +02:00
|
|
|
- event: push
|
2023-07-25 16:29:01 +02:00
|
|
|
branch:
|
|
|
|
- ${CI_REPO_DEFAULT_BRANCH}
|
|
|
|
- release/*
|
2023-07-12 23:25:05 +02:00
|
|
|
|
2022-07-17 18:25:56 +02:00
|
|
|
variables:
|
2022-10-25 14:51:29 +02:00
|
|
|
- &node_image 'node:18-alpine'
|
2023-07-10 14:46:55 +02:00
|
|
|
- &when
|
|
|
|
- path: &when_path
|
|
|
|
# related config files
|
|
|
|
- ".woodpecker/web.yml"
|
|
|
|
# web source code
|
|
|
|
- "web/**"
|
2023-07-11 22:52:18 +02:00
|
|
|
# api source code
|
|
|
|
- "server/api/**"
|
2023-07-10 14:46:55 +02:00
|
|
|
branch:
|
|
|
|
exclude: ${CI_REPO_DEFAULT_BRANCH}
|
|
|
|
event: push
|
|
|
|
- path: *when_path
|
|
|
|
event: [pull_request, tag, deployment]
|
2022-07-17 18:25:56 +02:00
|
|
|
|
2023-06-30 13:32:17 +02:00
|
|
|
steps:
|
2021-11-30 18:46:19 +02:00
|
|
|
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 18:46:19 +02:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm install --frozen-lockfile
|
2023-07-10 14:46:55 +02:00
|
|
|
when: *when
|
2021-11-30 18:46:19 +02: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 18:46:19 +02:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm lint
|
2023-07-10 14:46:55 +02:00
|
|
|
when: *when
|
2021-11-30 18:46:19 +02: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 18:46:19 +02:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm formatcheck
|
2023-07-10 14:46:55 +02:00
|
|
|
when: *when
|
2021-11-30 18:46:19 +02: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 18:46:19 +02:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm typecheck
|
2023-07-10 14:46:55 +02:00
|
|
|
when: *when
|
2021-11-30 18:46:19 +02: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 18:46:19 +02:00
|
|
|
commands:
|
2022-10-08 16:15:07 +02:00
|
|
|
- corepack enable
|
|
|
|
- pnpm test
|
2023-07-10 14:46:55 +02:00
|
|
|
when: *when
|