-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
83 lines (74 loc) · 1.9 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
image: node:22
cache:
key:
files:
- pnpm-lock.yaml
paths:
- .pnpm-store
- node_modules/
- packages/*/node_modules/
before_script:
- corepack enable
- corepack prepare pnpm@latest-9 --activate
- pnpm config set store-dir .pnpm-store
- pnpm install
stages:
- test
- codegen
- release
lint:
stage: test
script:
- pnpm lint
test:
stage: test
script:
- pnpm test:coverage
- curl -Os https://cli.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov upload-process -t $CODECOV_TOKEN
build:
stage: test
script:
- pnpm build
artifacts:
paths:
- apps/*/dist
- packages/*/dist
# Continuous Delivery
semantic-release:
stage: release
script:
- pnpm build
- pnpm exec multi-semantic-release
variables:
GIT_AUTHOR_NAME: 'gitlab-ci'
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: 'gitlab-ci'
GIT_COMMITTER_EMAIL: '[email protected]'
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: always
# Dependabot auto-merge functionality
# Note: GitLab has its own Dependency Scanning and Auto-merge features
# This can be configured in Settings > CI/CD > Merge request pipelines
# and Settings > General > Merge requests > Merge checks
regenerate-api:
stage: codegen
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /Bump the oas group/
script:
- pnpm api:regen
- pnpm format
- |
if [[ -n $(git status --porcelain) ]]; then
git config user.name "gitlab-ci"
git config user.email "[email protected]"
git add packages/rest/src/__generated__
git commit -nm "feat(rest): Update OpenAPI Spec generated code"
git push origin HEAD:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
fi
workflow:
rules:
- if: $CI_COMMIT_BRANCH
- if: $CI_MERGE_REQUEST_IID