forked from stoneatom/stonedb
-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (131 loc) · 4.6 KB
/
pull_requests.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: StoneDB Compile & MTR
on:
push:
branches-ignore:
- main
paths-ignore:
- 'Docs/**'
- 'docs/**'
- 'website/**'
- '**.md'
- 'scripts/setup/**'
- '.devcontainer/**'
- '.github/ISSUE_TEMPLATE/**'
pull_request:
branches-ignore:
- main
# wait for mergify to ignore
paths-ignore:
- 'Docs/**'
- 'docs/**'
- 'website/**'
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
#- 'scripts/**'
#- 'install_scripts/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
PROTOC: protoc
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-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.sha }}
- uses: actions/checkout@v3
with:
clean: false
# - name: Check License Header
# uses: apache/skywalking-eyes/header@main
- name: Ensure clang-format-10 is available
run: |
command -v clang-format-10 > /dev/null || (apt-get update && apt-get install -y clang-format-10)
- name: Format check
run: |
git diff -U0 --no-color ${{ github.event.pull_request.base.sha }} HEAD storage/tianmu | /usr/share/clang/clang-format-10/clang-format-diff.py -p1 | tee /tmp/.clang-format-diff
[ -s /tmp/.clang-format-diff ] && exit 1 || true
stonedb-build:
name: stonedb-build
needs: lint
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
os:
- debian10_1.0.3
- centos7_1.0.3
compiler:
- gcc-9.3
# exclude:
# - os: debian10_1.0.3
# compiler: gcc-9.3
env:
CCACHE_DIR: /tmp/ccache/stonedb/${{ matrix.os }}-${{ matrix.compiler }}
CCACHE_MAXSIZE: 8G
container:
image: stoneatom/stonedb_buildenv:${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
ssh-strict: 'false'
- name: compile stonedb
id: compile
run: |
case ${{ matrix.os }} in
debian10_1.0.3)
apt-get update && apt-get install curl lcov bc libssl-dev -y
;;
centos7_1.0.3)
yum install curl lcov.noarch bc.x86_64 -y
rm -rf /usr/bin/gcc && ln -s /opt/rh/devtoolset-9/root/bin/gcc /usr/bin/gcc
;;
esac
mkdir build && cd build
git config --global --add safe.directory /__w/stonedb/stonedb
git fetch --tags
cmake ../ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/stonedb57/install \
-DMYSQL_DATADIR=/stonedb57/install/data \
-DSYSCONFDIR=/stonedb57/install \
-DMYSQL_UNIX_ADDR=/stonedb57/install/tmp/mysql.sock \
-DWITH_EMBEDDED_SERVER=OFF \
-DWITH_TIANMU_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DDOWNLOAD_BOOST=0 \
-DWITH_BOOST=/usr/local/stonedb-boost/ \
-DDOWNLOAD_ROCKSDB=0 \
-DWITH_ROCKSDB=/usr/local/stonedb-gcc-rocksdb/ \
-DWITH_MARISA=/usr/local/stonedb-marisa/ \
-DDOWNLOAD_ROCKSDB=0 \
-DWITH_ROCKSDB=/usr/local/stonedb-gcc-rocksdb -DENABLE_GCOV=1 && make -j`nproc` && make -j`nproc` install
- name: mtr test
run: |
mkdir -p /stonedb57/install/log
groupadd mysql && useradd -g mysql mysql
chown -R mysql:mysql /stonedb57 && chown -R mysql:mysql ./build
cd /stonedb57/install/mysql-test
./mysql-test-run.pl --suite=innodb --nowarnings --force --nocheck-testcases --retry=0 --defaults-file=/stonedb57/install/mysql-test/suite/innodb/include/my_innodb.cnf --do-test-list=/stonedb57/install/mysql-test/suite/innodb/include/innodb_testlist
./mysql-test-run.pl --suite=tianmu --nowarnings --force --nocheck-testcases --retry=0 --parallel=10
- name: create coverage.info
run: |
cd build
lcov --capture --directory . --output-file coverage.info --test-name coverage
- name: Codecov
uses: codecov/codecov-action@v3.1.1