-
Notifications
You must be signed in to change notification settings - Fork 316
136 lines (136 loc) · 5.4 KB
/
build-cachelib-centos-8-5.yml
File metadata and controls
136 lines (136 loc) · 5.4 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
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: build-cachelib-centos-8.5
on:
# push:
pull_request:
schedule:
- cron: '0 9 * * *'
jobs:
build-cachelib-centos8-latest:
name: "CentOS/8.5 Build & Test"
runs-on: ubuntu-latest
# Docker container image name
container: "centos:latest"
steps:
- name: "Show Head Commit"
env:
CONTENT: ${{ toJSON(github.event.head_commit) }}
run: echo "$CONTENT"
- name: "patch CentOS Sources location (1st time)"
# CentOS 8.2 and later was changed into "CentOS Stream".
# Around the same time, CentOS 8.1 became EOL (End-Of-Life),
# And the repositories were moved to the legacy "vault.centos.org" URL.
# Patch the yum config file to this new location.
run: |
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- name: "update packages"
# stock centos has a problem with CMAKE, fails with:
# "cmake: symbol lookup error: cmake: undefined symbol: archive_write_add_filter_zstd"
# updating solves it
run: dnf update -y
- name: "patch CentOS Sources location (again...)"
# The "dnf update -y" above overwrites the yum configuration files,
# patch them again to point to the vault URLs.
run: |
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- name: "install sudo,git"
run: dnf install -y sudo git cmake gcc
- name: "System Information"
run: |
echo === uname ===
uname -a
echo === /etc/os-release ===
cat /etc/os-release
echo === /etc/centos-release ===
cat /etc/centos-release
echo === df -hl ===
df -hl
echo === nproc ===
nproc || true
echo === free -h ===
free -h
echo === top ===
top -b -n1 -1 -Eg || timeout 1 top -b -n1
echo === env ===
env
echo === gcc -v ===
gcc -v
- name: "checkout sources"
uses: actions/checkout@v3
- name: "Install Prerequisites"
run: ./contrib/build.sh -S -B
- name: "Test: update-submodules"
run: ./contrib/update-submodules.sh
- name: "Use cache for built libraries of submodules"
uses: actions/cache@v3
id: cache-submodules
with:
key: ${{ github.job }}-${{ hashFiles('.git/modules/*/HEAD') }}
path: |
opt/cachelib/lib
opt/cachelib/include
opt/cachelib/bin/thrift1
opt/cachelib/bin/fizz*
- name: "Install dependency: zstd"
run: ./contrib/build-package.sh -j -v -i zstd
- name: "Install dependency: googleflags"
run: ./contrib/build-package.sh -j -v -i googleflags
- name: "Install dependency: googlelog"
run: ./contrib/build-package.sh -j -v -i googlelog
- name: "Install dependency: googletest"
run: ./contrib/build-package.sh -j -v -i googletest
- name: "Install dependency: sparsemap"
run: ./contrib/build-package.sh -j -v -i sparsemap
- name: "Install dependency: fmt"
run: ./contrib/build-package.sh -j -v -i fmt
- name: "Install dependency: folly"
run: ./contrib/build-package.sh -j -v -i folly
if: steps.cache-submodules.outputs.cache-hit != 'true'
- name: "Install dependency: fizz"
run: ./contrib/build-package.sh -j -v -i fizz
if: steps.cache-submodules.outputs.cache-hit != 'true'
- name: "Install dependency: wangle"
run: ./contrib/build-package.sh -j -v -i wangle
if: steps.cache-submodules.outputs.cache-hit != 'true'
- name: "Install dependency: fbthrift"
run: ./contrib/build-package.sh -j -v -i fbthrift
if: steps.cache-submodules.outputs.cache-hit != 'true'
- name: "build CacheLib"
# Build cachelib in debug mode (-d) and with all tests (-t)
run: ./contrib/build-package.sh -j -v -i -d -t cachelib
- name: "Run tests"
run: ./.github/run_tests.sh
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cachelib-cmake-logs
path: |
build-cachelib/CMakeFiles/*.log
build-cachelib/CMakeCache.txt
build-cachelib/Makefile
build-cachelib/**/Makefile
if-no-files-found: warn
retention-days: 1
- uses: actions/upload-artifact@v3
with:
name: cachelib-test-logs
path: opt/cachelib/tests/*.log
if-no-files-found: warn
retention-days: 7
if: success() || failure()