-
Notifications
You must be signed in to change notification settings - Fork 11
214 lines (213 loc) · 7.14 KB
/
releases-rpm.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
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: Build Artifacts (RPM)
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
pull_request:
branches: [master, develop]
paths-ignore:
- '**/*.md'
- '.circleci/**'
- '.cirrus.yml'
push:
branches: [master, develop]
paths-ignore:
- '**/*.md'
- '.circleci/**'
- '.cirrus.yml'
release:
types: [published]
schedule:
- cron: '0 16 * * *'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
env:
CACHE_EPOCH: 125-1
GOPROXY: direct
jobs:
docker_publish:
strategy:
fail-fast: false
matrix:
container:
- 'centos7'
- 'centos8'
- 'fedora38'
- 'alpine319'
- 'opensuse15'
# - 'centos9'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Cache docker files (dummy)
id: docker-cache
uses: actions/cache@v4
with:
path: |
docker/dummy
key: ${{ runner.os }}-docker-${{ matrix.container }}-${{ hashFiles(format('docker/{0}.Dockerfile', matrix.container)) }}-v1
- name: Login to GitHub Container Registry
if: ${{ steps.docker-cache.outputs.cache-hit != 'true' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
if: ${{ steps.docker-cache.outputs.cache-hit != 'true' }}
run: |
cd docker
docker build --cache-from ghcr.io/chilledheart/${{ matrix.container }} \
-f ${{ matrix.container }}.Dockerfile \
-t ghcr.io/chilledheart/${{ matrix.container }} \
.
- name: Push Docker Image
if: ${{ steps.docker-cache.outputs.cache-hit != 'true' }}
run: |
docker push --all-tags ghcr.io/chilledheart/${{ matrix.container }}
rpm-release:
strategy:
fail-fast: false
matrix:
container:
- 'centos7'
- 'centos8'
- 'fedora38'
- 'opensuse15'
# - 'centos9'
runs-on: ubuntu-22.04
needs: docker_publish
container:
image: 'ghcr.io/chilledheart/${{ matrix.container }}'
env:
DISTRO: ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
- name: Checkout with shallow submodules
run: |
# ignore annoying failures
git config --global --add safe.directory "$PWD"
# unshallow must come first otherwise submodule may be get unshallowed
git fetch --tags --unshallow
git submodule update --init --depth 1
- name: Cache clang
id: clang-cache
uses: actions/cache@v4
if: ${{ env.DISTRO != 'centos7' }}
with:
path: |
third_party/llvm-build/Release+Asserts
key: ${{ runner.os }}-toolchain-${{ hashFiles('CLANG_REVISION') }}-v${{ env.CACHE_EPOCH }}
- name: Cache clang (el7)
id: clang-cache-el7
uses: actions/cache@v3
if: ${{ env.DISTRO == 'centos7' }}
with:
path: |
third_party/llvm-build/Release+Asserts
key: ${{ runner.os }}-toolchain-el7-${{ hashFiles('CLANG_REVISION') }}-v${{ env.CACHE_EPOCH }}
- name: Cache golang
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-docker-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-docker-
- name: "Install dependency: prebuilt clang and clang-tidy binaries"
if: ${{ steps.clang-cache.outputs.cache-hit != 'true' && env.DISTRO != 'centos7' }}
run: |
./scripts/download-clang-prebuilt-binaries.py
rm -f third_party/llvm-build/Release+Asserts/*.tgz
- name: "Install dependency: prebuilt clang and clang-tidy binaries (el7 patch)"
if: ${{ steps.clang-cache-el7.outputs.cache-hit != 'true' && env.DISTRO == 'centos7' }}
run: |
./scripts/download-clang-prebuilt-binaries.py
rm -f third_party/llvm-build/Release+Asserts/*.tgz
./scripts/libstdc++-el7.sh
- name: Set clang environment (centos and opensuse only)
if: ${{ env.DISTRO == 'centos7' || env.DISTRO == 'centos8' || env.DISTRO == 'centos9' || env.DISTRO == 'opensuse15' }}
run: |
echo "CC=${{ github.workspace }}/third_party/llvm-build/Release+Asserts/bin/clang" >> $GITHUB_ENV
echo "CXX=${{ github.workspace }}/third_party/llvm-build/Release+Asserts/bin/clang++" >> $GITHUB_ENV
- name: Set LTO environment
if: ${{ env.DISTRO == 'centos7' }}
run: |
# newer ld.lld doesn't work on glibc 2.17
echo "DISABLE_LLD=1" >> $GITHUB_ENV
- name: Build RPM packages
run: |
./scripts/build-rpm.sh
- name: Upload dist tarball (including debuginfo)
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload --clobber ${{ github.event.release.tag_name }} yass*.rpm
musl-release:
strategy:
fail-fast: false
matrix:
container:
- 'alpine319'
runs-on: ubuntu-22.04
needs: docker_publish
container:
image: 'ghcr.io/chilledheart/${{ matrix.container }}'
env:
DISTRO: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- name: Checkout with shallow submodules
run: |
# ignore annoying failures
git config --global --add safe.directory "$PWD"
# unshallow must come first otherwise submodule may be get unshallowed
git fetch --tags --unshallow
git submodule update --init --depth 1
- name: Cache golang
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-docker-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-docker-
- name: Build build tool
run: |
cd tools
go build
- name: Build TGZ packages
run: |
export CC=clang
export CXX=clang++
./tools/build --arch amd64 --system linux --subsystem musl -build-benchmark -build-test \
--cmake-build-type MinSizeRel
- name: Run tests (amd64)
run: |
./build-linux-musl-amd64/yass_test
./build-linux-musl-amd64/yass_benchmark
- name: Upload dist tarball (including debuginfo)
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} yass*.tgz
- name: Cleanup before Cache callbacks
run: |
rm -rf build-*