Repository navigation
161 lines (157 loc) · 4.99 KB
/
Copy pathpull_request.yml
File metadata and controls
161 lines (157 loc) · 4.99 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: pull_request
on:
pull_request:
types: [synchronize, reopened, labeled]
branches:
- master
- 'v[0-9]+.*'
defaults:
run:
shell: bash
jobs:
lint:
name: lint
if: ${{ contains(github.event.pull_request.labels.*.name, 'ready-for-testing') && github.event.pull_request.merged != true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- 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)
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Prepare Gherkin exec environ
run: make init-all -C tests
- name: Check Gherkin feature format
run: make check -C tests
build:
name: build
needs: lint
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
os:
- centos7
- ubuntu2004
compiler:
- gcc-9.2
- clang-9
exclude:
- os: centos7
compiler: clang-9
container:
image: vesoft/nebula-dev:${{ matrix.os }}
env:
TOOLSET_DIR: /opt/vesoft/toolset/clang/9.0.0
CCACHE_DIR: /tmp/ccache/nebula-graph/${{ matrix.os }}-${{ matrix.compiler }}
CCACHE_MAXSIZE: 8G
volumes:
- /tmp/ccache/nebula-graph/${{ matrix.os }}-${{ matrix.compiler }}:/tmp/ccache/nebula-graph/${{ matrix.os }}-${{ matrix.compiler }}
options: --cap-add=SYS_PTRACE
steps:
- name: Cleanup
if: ${{ always() }}
run: rm -rf *
- uses: actions/checkout@v2
- name: Prepare environment
id: prepare
run: |
[ -d build/ ] && rm -rf build/* || mkdir -p build
make init -C tests
- name: Checkout common
uses: actions/checkout@v2
with:
repository: ${{ github.repository_owner }}/nebula-common
path: modules/common
ref: ${{ github.base_ref }}
- name: Checkout storage
uses: actions/checkout@v2
with:
repository: ${{ github.repository_owner }}/nebula-storage
path: modules/storage
ref: ${{ github.base_ref }}
- name: CMake
id: cmake
run: |
case ${{ matrix.compiler }} in
gcc-*)
case ${{ matrix.os }} in
centos7)
# build with Release type
cmake \
-DCMAKE_CXX_COMPILER=$TOOLSET_DIR/bin/g++ \
-DCMAKE_C_COMPILER=$TOOLSET_DIR/bin/gcc \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=on \
-DENABLE_BUILD_STORAGE=on \
-B build
echo "::set-output name=j::10"
;;
ubuntu2004)
# build with Debug type
cmake \
-DCMAKE_CXX_COMPILER=$TOOLSET_DIR/bin/g++ \
-DCMAKE_C_COMPILER=$TOOLSET_DIR/bin/gcc \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_TESTING=on \
-DENABLE_BUILD_STORAGE=on \
-DNEBULA_USE_LINKER=lld \
-B build
echo "::set-output name=j::10"
;;
esac
;;
clang-*)
# build with Sanitizer
cmake \
-DCMAKE_CXX_COMPILER=$TOOLSET_DIR/bin/clang++ \
-DCMAKE_C_COMPILER=$TOOLSET_DIR/bin/clang \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_ASAN=on \
-DENABLE_TESTING=on \
-DENABLE_BUILD_STORAGE=on \
-DNEBULA_USE_LINKER=lld \
-B build
echo "::set-output name=j::6"
;;
esac
- name: Make graph
run: |
ccache -z
cmake --build build/ -j $(nproc)
ccache -s
- name: CTest
env:
ASAN_OPTIONS: fast_unwind_on_malloc=1
run: ctest -j $(($(nproc)/2+1)) --timeout 400 --output-on-failure
working-directory: build/
timeout-minutes: 20
- name: Pytest
run: |
make up
make RM_DIR=false DEBUG=false J=${{ steps.cmake.outputs.j }} test
make down
working-directory: tests/
timeout-minutes: 15
- name: TCK
run: |
make up
make RM_DIR=false DEBUG=false J=${{ steps.cmake.outputs.j }} tck
make down
working-directory: tests/
timeout-minutes: 25
- name: Sanitizer
if: ${{ always() }}
run: |
exit $(grep -P "SUMMARY: AddressSanitizer: \d+ byte\(s\) leaked in \d+ allocation\(s\)\." build/server_*/logs/*stderr.log | wc -l)
- name: Upload logs
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: ${{ matrix.os }}-${{ matrix.compiler }}-nebula-test-logs
path: build/server_*/logs/