-
Notifications
You must be signed in to change notification settings - Fork 120
144 lines (134 loc) · 4.09 KB
/
ya_make.yaml
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
name: Ya make
on:
push:
branches:
- main
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: 32GB
core-fraction: 100
disk-type: network-ssd-nonreplicated
disk-size: 372GB
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
- name: Checkout ydb
uses: actions/checkout@v3
with:
repository: ydb-platform/ydb
ref: 9602cbe953310f3b833b7b99cf5ced4021cdd63b
path: ydb
build:
name: Build
needs:
- start-vm
- checkout
with:
runs-on-value: ${{ needs.start-vm.outputs.label }}
build-python: true
build-ytsaurus-ya-make: true
build-query-tracker-ya-make-relwithdebinfo: true
uses: ./.github/workflows/build-jobs.yaml
tag:
name: Calculate docker tag
needs:
- start-vm
- build
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 =~ test ]];
then
IMAGE_TAG=test
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
docker:
name: Docker images
needs:
- start-vm
- tag
with:
runs-on-value: ${{ needs.start-vm.outputs.label }}
publish-query-tracker-ya-make-relwithdebinfo: true
image-tag: ${{ needs.tag.outputs.image-tag }}
nightly-image-tag: ${{ needs.tag.outputs.nightly-image-tag }}
secrets:
DOCKER_HUB_LOGIN: ${{ secrets.DOCKER_HUB_LOGIN }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
uses: ./.github/workflows/docker-jobs.yaml
stop-vm:
name: Stop VM
needs:
- start-vm
- docker
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-notifications:
name: Send notifications
needs:
- stop-vm
runs-on: trampoline
if: ${{ failure() }}
steps:
- name: Send telegram message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
disable_web_page_preview: true
format: markdown
message: |
Workflow *${{github.workflow}}* failed: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}.
Git ${{github.ref_type}}: *${{github.ref_name}}*.
Commit:
```
${{github.event.head_commit.message}}
```