forked from ytsaurus/ytsaurus
-
Notifications
You must be signed in to change notification settings - Fork 0
213 lines (198 loc) · 6.14 KB
/
cpp.yaml
File metadata and controls
213 lines (198 loc) · 6.14 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: C++ CI
on:
push:
branches:
- main
- stable/[0-9]+\.[0-9]+
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
start-vm:
name: Start VM
runs-on: trampoline
outputs:
label: ${{ steps.start-yc-runner.outputs.label }}
instance-id: ${{ steps.start-yc-runner.outputs.instance-id }}
steps:
- name: Start YC runner
id: start-yc-runner
uses: yc-actions/yc-github-runner@v1
with:
mode: start
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
folder-id: ${{ vars.YC_FOLDER_ID }}
image-id: ${{ vars.YC_DEFAULT_IMAGE_ID }}
zone-id: ${{ vars.YC_ZONE_ID }}
subnet-id: ${{ vars.YC_SUBNET_ID }}
cores: 16
memory: 64GB
core-fraction: 100
disk-type: network-ssd-nonreplicated
disk-size: 558GB
user: ${{ secrets.YC_VM_USERNAME }}
ssh-public-key: ${{ secrets.YC_VM_SSH_PUBLIC_KEY }}
public-ip: false
ttl: PT24H
runner-home-dir: /actions-runner
checkout:
name: Checkout sources
needs: start-vm
runs-on: ${{ needs.start-vm.outputs.label }}
steps:
- name: Checkout ytsaurus
uses: actions/checkout@v3
with:
path: ytsaurus
tag:
name: Calculate docker tag
needs:
- start-vm
- checkout
runs-on: ${{ needs.start-vm.outputs.label }}
outputs:
image-tag: ${{ steps.tag.outputs.IMAGE_TAG }}
nightly-image-tag: ${{ steps.tag.outputs.NIGHTLY_IMAGE_TAG }}
steps:
- name: Calculate docker tag
id: tag
run: |
if [[ $GITHUB_REF =~ main$ ]];
then
IMAGE_TAG=dev
elif [[ $GITHUB_REF =~ stable ]];
then
IMAGE_TAG=dev-${GITHUB_REF#refs/*/stable/}
else
IMAGE_TAG=dev-test
fi
NIGHTLY_IMAGE_TAG=${IMAGE_TAG}-$(git -C ytsaurus show -s --pretty=%cs)-${GITHUB_SHA}
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "NIGHTLY_IMAGE_TAG=$NIGHTLY_IMAGE_TAG" >> $GITHUB_OUTPUT
build-strawberry:
name: Build Strawberry controller
needs:
- start-vm
- checkout
- tag
with:
runs-on-value: ${{ needs.start-vm.outputs.label }}
build-strawberry: true
secrets:
BUILD_CACHE_BAZEL_USERNAME: ${{ secrets.BUILD_CACHE_BAZEL_USERNAME }}
BUILD_CACHE_BAZEL_PASSWORD: ${{ secrets.BUILD_CACHE_BAZEL_PASSWORD }}
uses: ./.github/workflows/build-jobs.yaml
build-cmake:
name: Build with cmake
needs:
- start-vm
- checkout
- build-strawberry
with:
runs-on-value: ${{ needs.start-vm.outputs.label }}
cpp-build-system: cmake
build-ytsaurus: true
build-chyt: ${{ github.ref_name == 'main' }}
build-python: true
update-remote-cache: true
secrets:
BUILD_CACHE_BAZEL_USERNAME: ${{ secrets.BUILD_CACHE_BAZEL_USERNAME }}
BUILD_CACHE_BAZEL_PASSWORD: ${{ secrets.BUILD_CACHE_BAZEL_PASSWORD }}
uses: ./.github/workflows/build-jobs.yaml
docker-cmake:
name: Docker images with cmake
needs:
- start-vm
- tag
- build-cmake
- build-strawberry
with:
runs-on-value: ${{ needs.start-vm.outputs.label }}
cpp-build-system: cmake
publish-strawberry: ${{ github.ref_name == 'main' }}
image-tag: ${{ needs.tag.outputs.image-tag }}
nightly-image-tag: ${{ needs.tag.outputs.nightly-image-tag }}
secrets:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
uses: ./.github/workflows/docker-jobs.yaml
build-ya-make:
name: Build with ya-make
needs:
- start-vm
- checkout
- build-strawberry
with:
runs-on-value: ${{ needs.start-vm.outputs.label }}
cpp-build-system: ya-make
build-ytsaurus: true
build-ytsaurus-tests: true
build-query-tracker: true
build-python: true
update-remote-cache: true
secrets:
BUILD_CACHE_BAZEL_USERNAME: ${{ secrets.BUILD_CACHE_BAZEL_USERNAME }}
BUILD_CACHE_BAZEL_PASSWORD: ${{ secrets.BUILD_CACHE_BAZEL_PASSWORD }}
uses: ./.github/workflows/build-jobs.yaml
docker-ya-make:
name: Docker images with ya-make
needs:
- start-vm
- tag
- build-ya-make
with:
runs-on-value: ${{ needs.start-vm.outputs.label }}
cpp-build-system: ya-make
publish-query-tracker: ${{ github.ref_name == 'main' }}
publish-ytsaurus: true
publish-local: true
publish-chyt: ${{ github.ref_name == 'main' }}
image-tag: ${{ needs.tag.outputs.image-tag }}
nightly-image-tag: ${{ needs.tag.outputs.nightly-image-tag }}
secrets:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
uses: ./.github/workflows/docker-jobs.yaml
check:
name: Check
needs:
- start-vm
- build-cmake
- build-ya-make
with:
runs-on-value: ${{ needs.start-vm.outputs.label }}
uses: ./.github/workflows/check-jobs.yaml
stop-vm:
name: Stop VM
needs:
- start-vm
- check
- docker-cmake
- docker-ya-make
runs-on: trampoline
if: ${{ always() }}
steps:
- name: Stop YC runner
uses: yc-actions/yc-github-runner@v1
with:
mode: stop
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-vm.outputs.label }}
instance-id: ${{ needs.start-vm.outputs.instance-id }}
send-alert:
needs:
- check
- build-cmake
- build-ya-make
- docker-ya-make
- docker-cmake
- build-strawberry
if: always()
uses: ./.github/workflows/check-status-and-send-alert.yaml
with:
is_failure: ${{ contains(join(needs.*.result, ','), 'failure') }}
secrets:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}