forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (133 loc) · 4.85 KB
/
CodeQuality.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: CodeQuality
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
- '.github/workflows/**'
- '!.github/workflows/CodeQuality.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/master' || github.sha }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
AWS_ACCESS_KEY_ID: AKIAVBLKPL2ZW2T7TYFQ
AWS_SECRET_ACCESS_KEY: ${{ secrets.NODE_PRE_GYP_SECRETACCESSKEY }}
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
jobs:
format-check:
name: Format Check
runs-on: ubuntu-20.04
env:
CC: gcc-10
CXX: g++-10
GEN: ninja
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build clang-format && sudo pip3 install cmake-format
- name: Format Check
shell: bash
run: |
clang-format --version
clang-format --dump-config
make format-check-silent
tidy-check:
name: Tidy Check
runs-on: ubuntu-20.04
needs: format-check
env:
CC: gcc-10
CXX: g++-10
GEN: ninja
TIDY_THREADS: 4
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build clang-tidy && sudo pip3 install pybind11[global]
- name: Cache clang-tidy
id: date
shell: bash
run: echo "::set-output name=now::$(date)"
- name: Cache clang-tidy
uses: actions/cache@v3
with:
path: ~/.ctcache/cache
key: clang-tidy-${{ steps.date.outputs.now }}
restore-keys: |
clang-tidy
- name: Download clang-tidy-cache
shell: bash
run: |
set -e
curl -Lo /tmp/clang-tidy-cache https://github.com/ejfitzgerald/clang-tidy-cache/releases/download/v0.4.0/clang-tidy-cache-linux-amd64
md5sum /tmp/clang-tidy-cache | grep 880b290d7bbe7c1fb2a4f591f9a86cc1
chmod +x /tmp/clang-tidy-cache
- name: Tidy Check
shell: bash
run: make tidy-check TIDY_BINARY=/tmp/clang-tidy-cache
codecov:
name: CodeCov
runs-on: ubuntu-20.04
needs: tidy-check
env:
GEN: ninja
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build lcov curl
- name: Validate Configuration
shell: bash
run: |
curl --fail --data-binary @.codecov.yml https://codecov.io/validate
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Before Install
shell: bash
run: |
pip install --prefer-binary "pandas>=1.2.4" "requests>=2.26" "pyarrow==8.0" "psutil>=5.9.0" pytest
sudo apt-get install g++
- name: Coverage Reset
shell: bash
run: |
lcov --config-file .github/workflows/lcovrc --zerocounters --directory .
lcov --config-file .github/workflows/lcovrc --capture --initial --directory . --base-directory . --no-external --output-file coverage.info
- name: Run Tests
shell: bash
run: |
mkdir -p build/coverage
(cd build/coverage && cmake -E env CXXFLAGS="--coverage" cmake -DBUILD_PYTHON=1 -DBUILD_PARQUET_EXTENSION=1 -DBUILD_JSON_EXTENSION=1 -DENABLE_SANITIZER=0 -DCMAKE_BUILD_TYPE=Debug ../.. && make)
(cd tools/pythonpkg/tests/fast && python3 -m pytest)
(cd tools/pythonpkg/tests/coverage && python3 -m pytest)
build/coverage/test/unittest
build/coverage/test/unittest "[intraquery]"
build/coverage/test/unittest "[interquery]"
python3 scripts/try_timeout.py --timeout=4800 --retry=3 build/coverage/test/unittest "[coverage]"
build/coverage/test/unittest "[detailed_profiler]"
build/coverage/test/unittest test/sql/tpch/tpch_sf01.test_slow
build/coverage/tools/sqlite3_api_wrapper/test_sqlite3_api_wrapper
python tools/shell/shell-test.py build/coverage/duckdb
- name: Generate Coverage
shell: bash
run: |
lcov --config-file .github/workflows/lcovrc --directory . --base-directory . --no-external --capture --output-file coverage.info
lcov --config-file .github/workflows/lcovrc --remove coverage.info $(< .github/workflows/lcov_exclude) -o lcov.info
- name: CodeCov Upload
uses: codecov/codecov-action@v2
with:
files: lcov.info
fail_ci_if_error: true