Update main.yml #62
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: [ ci ] | |
pull_request: | |
branches: [ ci ] | |
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 ./... |