-
Notifications
You must be signed in to change notification settings - Fork 3
142 lines (135 loc) · 4.22 KB
/
check.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
name: Check
on:
push:
branches:
- main
- members/nadya73/tests
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: fd84cji032a91np7mpgn
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: 279GB
user: ${{ secrets.YC_VM_USERNAME }}
ssh-public-key: ${{ secrets.YC_VM_SSH_PUBLIC_KEY }}
public-ip: false
checkout:
name: Checkout sources
needs: start-vm
runs-on: ${{ needs.start-vm.outputs.label }}
steps:
- name: Checkout ytsaurus-cpp-sdk
uses: actions/checkout@v3
build:
name: Build
needs:
- start-vm
- checkout
runs-on: ${{ needs.start-vm.outputs.label }}
steps:
- name: Build with libc++
run: |
mkdir -p ../build
cd ../build
rm -rf *
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=../ytsaurus-cpp-sdk/clang.toolchain \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DREQUIRED_LLVM_TOOLING_VERSION=14 \
-DCMAKE_CXX_FLAGS_INIT="-stdlib=libc++" \
../ytsaurus-cpp-sdk
export CCACHE_BASEDIR="$(realpath ..)"
export CCACHE_REMOTE_ONLY=true
export CCACHE_REMOTE_STORAGE="${{ vars.CCACHE_REMOTE_STORAGE }}"
cd ../build
ninja
- name: Build with libstdc++
run: |
mkdir -p ../build_gcc
cd ../build_gcc
rm -rf *
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=../ytsaurus-cpp-sdk/clang.toolchain \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DREQUIRED_LLVM_TOOLING_VERSION=14 \
-DCMAKE_CXX_FLAGS_INIT="-stdlib=libstdc++ -std=c++20" \
../ytsaurus-cpp-sdk
export CCACHE_BASEDIR="$(realpath ..)"
export CCACHE_REMOTE_ONLY=true
export CCACHE_REMOTE_STORAGE="${{ vars.CCACHE_REMOTE_STORAGE }}"
cd ../build_gcc
ninja
tests:
name: Tests
needs:
- start-vm
- checkout
- build
runs-on: ${{ needs.start-vm.outputs.label }}
steps:
- name: Run unittests (libc++)
run: |
cp ../ytsaurus-cpp-sdk/yt/yt/scripts/run_unittests.sh ../build
cd ../build
./run_unittests.sh
stop-vm:
name: Stop VM
needs:
- start-vm
- tests
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: ubuntu-latest
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}}
```