-
Notifications
You must be signed in to change notification settings - Fork 66
173 lines (156 loc) · 4.97 KB
/
_extension_code_quality.yml
File metadata and controls
173 lines (156 loc) · 4.97 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
162
163
164
165
166
167
168
169
170
171
172
173
name: CodeQuality
on:
workflow_call:
inputs:
explicit_checks:
type: string
required: false
extension_name:
type: string
required: true
override_repository:
type: string
required: false
override_ref:
type: string
required: false
duckdb_version:
type: string
required: true
override_ci_tools_repository:
type: string
required: false
default: "duckdb/extension-ci-tools"
ci_tools_version:
type: string
required: true
extra_toolchains:
type: string
required: false
format_checks:
type: string
required: false
default: "format;tidy"
# Override the default vcpkg repository
vcpkg_url:
required: false
type: string
default: "https://github.com/microsoft/vcpkg.git"
# Override the default vcpkg commit used by this version of DuckDB
vcpkg_commit:
required: false
type: string
default: "ce613c41372b23b1f51333815feb3edd87ef8a8b"
# Experimental option to allow automatically building the vcpkg dependencies of duckdb extensions that are used for testing
use_merged_vcpkg_manifest:
required: false
type: string
default: ""
secrets:
GH_TOKEN:
required: false
repository_dispatch:
merge_group:
pull_request:
types: [opened, reopened]
paths-ignore:
- '**.md'
- '.github/workflows/**'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
format-check:
name: Format Check
if: contains(inputs.format_checks, 'format')
runs-on: ubuntu-22.04
env:
CC: gcc-10
CXX: g++-10
GEN: ninja
steps:
- uses: actions/checkout@v4
name: Checkout override repository
if: ${{inputs.override_repository != ''}}
with:
repository: ${{ inputs.override_repository }}
ref: ${{ inputs.override_ref }}
fetch-depth: 0
submodules: 'recursive'
- uses: actions/checkout@v4
name: Checkout current repository
if: ${{inputs.override_repository == ''}}
with:
fetch-depth: 0
submodules: 'recursive'
- uses: actions/checkout@v4
name: Checkout Extension CI tools
with:
path: 'extension-ci-tools'
ref: ${{ inputs.ci_tools_version }}
repository: ${{ inputs.override_ci_tools_repository }}
- name: Install
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build clang-format-11 && sudo pip3 install cmake-format 'black==24.*' cxxheaderparser pcpp 'clang_format==11.0.1'
- name: List Installed Packages
shell: bash
run: pip3 freeze
- name: Format Check
shell: bash
run: |
clang-format --version
clang-format --dump-config
black --version
make format-check
tidy-check:
name: Tidy Check
if: contains(inputs.format_checks, 'tidy')
runs-on: ubuntu-24.04
env:
CC: gcc
CXX: g++
GEN: ninja
TIDY_THREADS: 4
TIDY_CHECKS: ${{ inputs.explicit_checks && inputs.explicit_checks || '' }}
steps:
- uses: actions/checkout@v4
name: Checkout override repository
if: ${{inputs.override_repository != ''}}
with:
repository: ${{ inputs.override_repository }}
ref: ${{ inputs.override_ref }}
fetch-depth: 0
submodules: 'recursive'
- uses: actions/checkout@v4
name: Checkout current repository
if: ${{inputs.override_repository == ''}}
with:
fetch-depth: 0
submodules: 'recursive'
- uses: actions/checkout@v4
name: Checkout Extension CI tools
with:
path: 'extension-ci-tools'
ref: ${{ inputs.ci_tools_version }}
repository: ${{ inputs.override_ci_tools_repository }}
- 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] --break-system-packages
- name: Setup vcpkg
shell: bash
run: |
mkdir local_vcpkg_installation
cmake --version
cd local_vcpkg_installation
git init
git remote add origin ${{ inputs.vcpkg_url }}
git fetch origin ${{ inputs.vcpkg_commit }}
git checkout ${{ inputs.vcpkg_commit }}
./bootstrap-vcpkg.sh
echo "VCPKG_ROOT=${{ github.workspace }}/local_vcpkg_installation" >> $GITHUB_ENV
echo "VCPKG_TOOLCHAIN_PATH=${{ github.workspace }}/local_vcpkg_installation/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV
echo "${{ github.workspace }}/local_vcpkg_installation" >> $GITHUB_PATH
- name: Tidy Check Diff
shell: bash
env:
USE_MERGED_VCPKG_MANIFEST: ${{ inputs.use_merged_vcpkg_manifest }}
run: make tidy-check