-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
102 lines (92 loc) · 1.94 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
image: node:20-alpine
services:
- name: docker:24.0.6-dind
command:
- --tls=false
- --registry-mirror=https://mirror.gcr.io
variables:
DOCKER_HOST: tcp://0.0.0.0:2375
DOCKER_TLS_CERTDIR: ''
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: '1'
DOCKER_MEMORY: '4g'
DOCKER_CPUS: '2'
TESTCONTAINERS_HOST_OVERRIDE: 'host.docker.internal'
KUBERNETES_MEMORY_REQUEST: 3Gi
KUBERNETES_MEMORY_LIMIT: 6Gi
KUBERNETES_CPU_REQUEST: '0.5'
KUBERNETES_CPU_LIMIT: '1'
cache:
- key: yarn-workspace
paths:
- node_modules/
- .yarn
stages:
- build
- test
- comment
- release
build-lib:
stage: build
only: ['merge_requests', 'main']
script:
- yarn --immutable
- yarn build --filter='./libs/*'
artifacts:
paths:
- libs/crud/dist
- libs/nestjs-utils/dist
build-samples:
stage: build
only: ['merge_requests', 'main']
allow_failure: true
script:
- yarn --immutable
- yarn build --filter='./samples/*'
artifacts:
paths:
- libs/crud/dist
- libs/nestjs-utils/dist
# changeset-mr-comment:
# stage: comment
# only: ["merge_requests"]
# script:
# - yarn --immutable
# - yarn changesets-gitlab comment
test-lib:
stage: build
needs: ['build-lib']
only: ['merge_requests', 'main']
script:
- yarn --immutable
- yarn turbo run test --filter='./libs/*'
artifacts:
paths:
- libs/**/coverage*/
cache:
paths:
- node_modules/
- .yarn
test-samples:
stage: build
needs: ['build-samples']
only: ['merge_requests', 'main']
allow_failure: true
script:
- yarn --immutable
- yarn turbo run test --filter='./samples/*'
- yarn turbo run lint --filter='./samples/*'
cache:
paths:
- node_modules/
- .yarn
release:
stage: release
only: ['main']
script:
- apk add --no-cache git
- yarn --immutable
- yarn postinstall
- yarn changesets-gitlab
variables:
INPUT_PUBLISH: yarn release