-
Notifications
You must be signed in to change notification settings - Fork 5
72 lines (63 loc) · 2.3 KB
/
main.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
# https://github.com/mvdan/github-actions-golang
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
strategy:
matrix:
go: [1.18.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Dependencies
run: |
sudo apt install gcc-9 g++-9
sudo apt install libgflags-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
sudo apt install libsnappy-dev
- name: Cache rocksdb
id: cache-rocksdb
uses: actions/cache@v2
with:
path: rocksdb-5.18.4
key: ${{ runner.os }}-rocksdb-5.18.4-static
- name: Build rocksdb
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
run: |
wget https://github.com/facebook/rocksdb/archive/refs/tags/v5.18.4.tar.gz
tar zxvf v5.18.4.tar.gz
cd rocksdb-5.18.4
# make CC=gcc-9 CXX=g++-9 static_lib
wget -O - https://raw.githubusercontent.com/smartbch/artifacts/main/patches/rocksdb.gcc11.patch | git apply -v
CXXFLAGS=-Wno-range-loop-construct PORTABLE=1 make -j4 static_lib
strip --strip-unneeded librocksdb.a
# make EXTRA_CXXFLAGS="-march=x86-64" CC=gcc-9 CXX=g++-9 static_lib
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-18
- name: Checkout
uses: actions/checkout@v2
with:
path: moeingads
- name: Build & Test
run: |
export ROCKSDB_PATH="$PWD/rocksdb-5.18.4"
export CGO_CFLAGS="-I$ROCKSDB_PATH/include"
export CGO_LDFLAGS="-L$ROCKSDB_PATH -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4 -lzstd"
cd moeingads
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
/home/runner/go/bin/golangci-lint run
go build -tags cppbtree ./...
go test -tags cppbtree ./...