Fix test #5546
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CodeQuality | |
on: | |
workflow_dispatch: | |
inputs: | |
explicit_checks: | |
type: string | |
repository_dispatch: | |
push: | |
branches: | |
- '**' | |
- '!main' | |
- '!feature' | |
paths-ignore: | |
- '**.md' | |
- '.github/patches/duckdb-wasm/**' | |
- '.github/workflows/**' | |
- '!.github/workflows/lcov_exclude' | |
- '!.github/workflows/CodeQuality.yml' | |
pull_request: | |
types: [opened, reopened, ready_for_review] | |
paths-ignore: | |
- '**.md' | |
- '.github/patches/duckdb-wasm/**' | |
- '.github/workflows/**' | |
- '!.github/workflows/lcov_exclude' | |
- '!.github/workflows/CodeQuality.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }} | |
cancel-in-progress: true | |
env: | |
GH_TOKEN: ${{ secrets.GH_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@v4 | |
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-11 && sudo pip3 install cmake-format black cxxheaderparser pcpp | |
- 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-silent | |
- name: Generated Check | |
shell: bash | |
run: | | |
make generate-files | |
git diff --exit-code | |
enum-check: | |
name: C Enum Integrity Check | |
needs: format-check | |
runs-on: ubuntu-20.04 | |
env: | |
CC: gcc-10 | |
CXX: g++-10 | |
GEN: ninja | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install python dependencies | |
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
shell: bash | |
run: python -m pip install cxxheaderparser pcpp | |
- name: Verify C enum integrity | |
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
shell: bash | |
run: python scripts/verify_enum_integrity.py src/include/duckdb.h | |
tidy-check: | |
name: Tidy Check | |
runs-on: ubuntu-24.04 | |
needs: format-check | |
env: | |
CC: gcc | |
CXX: g++ | |
GEN: ninja | |
TIDY_THREADS: 4 | |
TIDY_CHECKS: ${{ inputs.explicit_checks && inputs.explicit_checks || '' }} | |
steps: | |
- uses: actions/checkout@v4 | |
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] --break-system-packages | |
- name: Setup Ccache | |
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/feature' }} | |
uses: hendrikmuhs/ccache-action@main | |
with: | |
key: ${{ github.job }} | |
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }} | |
- name: Download clang-tidy-cache | |
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/feature' }} | |
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 | |
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/feature' }} | |
run: make tidy-check TIDY_BINARY=/tmp/clang-tidy-cache | |
- name: Tidy Check Diff | |
shell: bash | |
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/feature' }} | |
run: make tidy-check-diff |