-
Notifications
You must be signed in to change notification settings - Fork 290
134 lines (122 loc) · 5.31 KB
/
docker.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
name: Docker build
'on':
pull_request:
push:
branches:
- master
- develop
- feature/**
jobs:
tests:
strategy:
fail-fast: false
matrix:
include:
- cmake-flags: >-
-DCMAKE_CXX_STANDARD=17
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
-DUSERVER_FEATURE_CORE=1
-DUSERVER_FEATURE_CHAOTIC=0
gtest-filter: ''
image: ubuntu-22.04-userver-base
info: ubuntu + gcc + cxx17 + core
id: ubuntu_clang_cxx17_core
- cmake-flags: >-
-DCMAKE_C_COMPILER=clang-16
-DCMAKE_CXX_COMPILER=clang++-16
-DCMAKE_CXX_STANDARD=17
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
gtest-filter: ''
image: ubuntu-22.04-userver-base-ci
info: ubuntu + clang + cxx17
id: ubuntu_clang_cxx17
- cmake-flags: >-
-DCMAKE_C_COMPILER=gcc-11
-DCMAKE_CXX_COMPILER=g++-11
-DCMAKE_CXX_STANDARD=17
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
gtest-filter: ''
image: ubuntu-22.04-userver-base-ci
info: ubuntu + gcc + cxx17
id: ubuntu_gcc_cxx17
- cmake-flags: >-
-DCMAKE_C_COMPILER=clang-16
-DCMAKE_CXX_COMPILER=clang++-16
-DCMAKE_CXX_STANDARD=20
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
gtest-filter: -YdbExecuteTpl/1.SimpleWriteReadBinary
image: ubuntu-22.04-userver-base-ci
info: ubuntu + clang + cxx20
id: ubuntu_clang_cxx20
- cmake-flags: >-
-DCMAKE_C_COMPILER=gcc-11
-DCMAKE_CXX_COMPILER=g++-11
-DCMAKE_CXX_STANDARD=20
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
gtest-filter: ''
image: ubuntu-22.04-userver-base-ci
info: ubuntu + gcc + cxx20
id: ubuntu_gcc_cxx20
runs-on: ubuntu-latest
name: '${{ matrix.info }}'
steps:
- uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt install -y docker-compose
- name: Reuse ccache directory
uses: actions/cache@v4
with:
path: .ccache
key: 'ccache-dir-${{ matrix.id }}_${{github.ref}}_run-${{github.run_number}}'
restore-keys: |
ccache-dir-${{ matrix.id }}_${{github.ref}}_run-
ccache-dir-${{ matrix.id }}_
ccache-
- name: Free disk space
run: |
df -h
# See https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/lib/php* /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup || true
df -h
- name: Setup ccache
run: docker-compose -f .github/docker-compose.yml run --rm ${{ matrix.image
}} bash -c 'ccache -M 2.0GB && ccache -s'
- name: CMake
run: >-
docker-compose -f .github/docker-compose.yml
run --rm ${{ matrix.image}} bash -c
'cmake -DUSERVER_GOOGLE_COMMON_PROTOS=/app/api-common-protos
${{ matrix.cmake-flags }} -B./build -S./'
- name: Build
run: >-
docker-compose -f .github/docker-compose.yml
run --rm ${{ matrix.image}} bash -c
'cd /userver/build && make -j $(nproc)'
- name: Run ydb
run: docker-compose -f .github/docker-compose.yml run -d --rm run-ydb
- name: Watch ydb
run: >-
docker-compose -f .github/docker-compose.yml
run --rm ${{ matrix.image}} bash -c
'curl --retry 15 --retry-all-errors --retry-delay 5 -s -o /dev/null
http://run-ydb:8765/monitoring/ -v'
- name: Run tests
run: >-
docker-compose -f .github/docker-compose.yml
run --rm ${{ matrix.image}} bash -c
'cd /userver/build && ulimit -n 4096 && GTEST_FILTER="${{ matrix.gtest-filter }}" ctest -V'