forked from vesoft-inc/nebula
-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (111 loc) · 3.23 KB
/
pull_request.yaml
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
name: pull_request
on:
pull_request:
types: [synchronize, reopened, labeled]
branches:
- master
- 'v[0-9]+.*'
defaults:
run:
shell: bash
jobs:
lint:
name: cpplint
if: ${{ contains(github.event.pull_request.labels.*.name, 'ready-for-testing') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Cpplint
run: |
ln -snf $PWD/.linters/cpp/hooks/pre-commit.sh $PWD/.linters/cpp/pre-commit.sh
.linters/cpp/pre-commit.sh $(git --no-pager diff --diff-filter=d --name-only HEAD^ HEAD)
build:
name: build
needs: lint
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
os:
- centos7
- ubuntu1804
compiler:
- gcc-9.2
- clang-9
exclude:
- os: centos7
compiler: clang-9
container:
image: vesoft/nebula-dev:${{ matrix.os }}
env:
CCACHE_DIR: /tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}
CCACHE_MAXSIZE: 1G
volumes:
- /tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}:/tmp/ccache/nebula/${{ matrix.os }}-${{ matrix.compiler }}
options: --mount type=tmpfs,destination=/tmp/ccache/nebula,tmpfs-size=1073741824 --cap-add=SYS_PTRACE
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Prepare environment
run: |
[ -d build/ ] && rm -rf build/* || mkdir -p build
- name: CMake
run: |
case ${{ matrix.os }} in
centos7)
# build with coverage
cmake -DENABLE_COVERAGE=ON -B build/
;;
ubuntu1804)
case ${{ matrix.compiler }} in
gcc*)
# build with release type
cmake -DCMAKE_BUILD_TYPE=Release -B build/
;;
clang*)
cmake \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DENABLE_ASAN=on \
-B build/
;;
esac
;;
esac
- name: Make
run: cmake --build build/ -j $(($(nproc)/2+1))
- name: CTest with multiple threads
timeout-minutes: 15
working-directory: build
env:
ASAN_OPTIONS: fast_unwind_on_malloc=1
run: |
ctest \
-j $(($(nproc)/2+1)) \
--timeout 400 \
--output-on-failure
- name: CTest with single thread
if: failure()
timeout-minutes: 30
working-directory: build
env:
ASAN_OPTIONS: fast_unwind_on_malloc=0
run: |
ctest \
--timeout 400 \
--output-on-failure \
--rerun-failed
- name: Testing Coverage Report
working-directory: build
if: success() && matrix.compiler == 'gcc-9.2' && matrix.os == 'centos7'
run: |
set -e
fastcov -o coverage.info -l --exclude=scanner.lex
lcov --remove coverage.info '*/opt/vesoft/*' -o clean.info
bash <(curl -s https://codecov.io/bash) -Z -f clean.info
- name: Cleanup
if: always()
run: rm -rf build