-
Notifications
You must be signed in to change notification settings - Fork 15
118 lines (111 loc) · 3.37 KB
/
ci.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
name: CI
'on':
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}'
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
working-directory: cxx-async
run: cargo clippy -- -D warnings
build:
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
git \
cmake \
make \
gcc \
g++ \
clang \
autoconf \
automake \
libtool \
python3-pip \
ninja-build \
libgflags-dev \
libdouble-conversion-dev \
libevent-dev \
libgflags-dev \
libgoogle-glog-dev \
libssl-dev \
libunwind-dev \
liblz4-dev \
liblzma-dev \
zlib1g-dev \
libsnappy-dev \
binutils-dev \
libjemalloc-dev \
libiberty-dev
- name: Build fmt
working-directory: /tmp/
run: |
git clone https://github.com/fmtlib/fmt.git && cd fmt
rm _build -rf; mkdir _build -p && cd _build
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DFMT_TEST=OFF
make -j$(nproc)
sudo make install
sudo ldconfig
- name: Build fast_float
working-directory: /tmp/
run: |
git clone https://github.com/fastfloat/fast_float.git && cd fast_float
rm _build -rf; mkdir _build -p && cd _build
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_FLAGS="-O3" \
-DBUILD_SHARED_LIBS=TRUE \
-DBUILD_BENCHMARKS=OFF
make -j$(nproc)
sudo make install
sudo ldconfig
- name: Build Folly
working-directory: /tmp/
run: |
git clone https://github.com/facebook/folly.git
cd folly
python3 build/fbcode_builder/getdeps.py --shared-libs build --no-tests boost
install_dir=$(python3 ./build/fbcode_builder/getdeps.py show-inst-dir)
boost_inst_dir=$(dirname "$install_dir")
boost_paths=$(find "$boost_inst_dir" -maxdepth 1 -type d -name "boost*")
sudo cp -avf $boost_paths/include /usr/local
sudo cp -avf $boost_paths/lib /usr/local
sudo ldconfig
rm _build -rf
mkdir _build && cd _build
cmake .. -DBUILD_SHARED_LIBS=ON \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_BENCHMARKS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON
make -j$(nproc)
sudo make install
sudo ldconfig
- name: Build
working-directory: cxx-async
run: |
cargo build