Skip to content

Commit 6937984

Browse files
committed
Fix format-check job on CI (1.5)
This is a backport of the PR #387 to `v1.5-variegata` stable branch. `CodeQuality.yml` job has started failing ([example](https://github.com/duckdb/duckdb-odbc/actions/runs/21621925131/job/62312692935?pr=385)) due to the `black` package update. This PR cleans up the job and pins the `black` package to the known compatible version.
1 parent c0d134a commit 6937984

File tree

2 files changed

+12
-63
lines changed

2 files changed

+12
-63
lines changed

.github/workflows/CodeQuality.yml

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,93 +6,39 @@ on:
66
branches:
77
- '**'
88
- '!main'
9-
- '!feature'
109
paths-ignore:
1110
- '**.md'
12-
- '.github/patches/duckdb-wasm/**'
1311
- '.github/workflows/**'
14-
- '!.github/workflows/lcov_exclude'
1512
- '!.github/workflows/CodeQuality.yml'
1613

1714
pull_request:
1815
types: [opened, reopened, ready_for_review, synchronize]
1916
paths-ignore:
2017
- '**.md'
2118
- '.github/workflows/**'
22-
- '!.github/workflows/lcov_exclude'
2319
- '!.github/workflows/CodeQuality.yml'
2420

25-
concurrency:
26-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
27-
cancel-in-progress: true
28-
29-
env:
30-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
31-
3221
jobs:
3322
format-check:
3423
name: Format Check
35-
runs-on: ubuntu-22.04
36-
if: ${{ !(github.event_name == 'pull_request' && github.head_ref == 'vendoring') }}
37-
38-
env:
39-
CC: gcc-10
40-
CXX: g++-10
41-
GEN: ninja
24+
runs-on: ubuntu-latest
25+
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'vendoring-')) }}
4226

4327
steps:
4428
- uses: actions/checkout@v4
45-
with:
46-
fetch-depth: 0
4729

4830
- name: Install
49-
shell: bash
5031
run: |
51-
sudo apt-get update -y -qq
52-
sudo apt-get install -y -qq ninja-build clang-format-11
53-
sudo pip3 install cmake-format black clang_format==11.0.1
32+
sudo pip3 install \
33+
black==25.1.0 \
34+
clang_format==11.0.1 \
35+
cmake-format==0.6.13
5436
5537
- name: Format Check
56-
shell: bash
5738
run: |
39+
python -m pip show black
40+
python -m pip show cmake_format
41+
python -m pip show clang_format
5842
clang-format --version
5943
clang-format --dump-config
60-
black --version
6144
make format-check-silent
62-
63-
# tidy-check:
64-
# name: Tidy Check
65-
# runs-on: ubuntu-22.04
66-
# needs: format-check
67-
#
68-
# env:
69-
# CC: gcc-10
70-
# CXX: g++-10
71-
# GEN: ninja
72-
# TIDY_THREADS: 4
73-
#
74-
# steps:
75-
# - uses: actions/checkout@v4
76-
# with:
77-
# fetch-depth: 0
78-
#
79-
# - name: Install
80-
# shell: bash
81-
# run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build clang-tidy && sudo pip3 install pybind11[global]
82-
#
83-
# - name: Setup Ccache
84-
# uses: hendrikmuhs/ccache-action@main
85-
# with:
86-
# key: ${{ github.job }}
87-
# save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }}
88-
# - name: Download clang-tidy-cache
89-
# shell: bash
90-
# run: |
91-
# set -e
92-
# curl -Lo /tmp/clang-tidy-cache https://github.com/ejfitzgerald/clang-tidy-cache/releases/download/v0.4.0/clang-tidy-cache-linux-amd64
93-
# md5sum /tmp/clang-tidy-cache | grep 880b290d7bbe7c1fb2a4f591f9a86cc1
94-
# chmod +x /tmp/clang-tidy-cache
95-
#
96-
# - name: Tidy Check
97-
# shell: bash
98-
# run: make tidy-check TIDY_BINARY=/tmp/clang-tidy-cache

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ format-fix:
2828
rm -rf src/amalgamation/*
2929
python3 scripts/format.py --all --fix --noconfirm
3030

31+
format-check:
32+
python3 scripts/format.py --all --check
33+
3134
format-check-silent:
3235
python3 scripts/format.py --all --check --silent
3336

0 commit comments

Comments
 (0)