Skip to content

Commit c4d14bf

Browse files
committed
extract out git+checkout into custom action to avoid duplicating it in all jobs that use linux containers
1 parent c1a888f commit c4d14bf

7 files changed

Lines changed: 46 additions & 46 deletions

File tree

.clang-tidy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
Checks: >
2+
portability-avoid-pragma-once,
3+
bugprone-unchecked-optional-access,
4+
hicpp-no-array-decay,
25
clang-analyzer-*,
36
bugprone-*,
47
performance-*,
@@ -14,7 +17,9 @@ Checks: >
1417
-hicpp-signed-bitwise,
1518
-modernize-use-trailing-return-type,
1619
-hicpp-uppercase-literal-suffix,
17-
-bugprone-easily-swappable-parameters
20+
-bugprone-easily-swappable-parameters,
21+
bugprone-unchecked-optional-access,
22+
-portability-avoid-pragma-once
1823
WarningsAsErrors: "*"
19-
HeaderFilterRegex: "(src|test)/"
24+
HeaderFilterRegex: "(src)/"
2025
FormatStyle: none

.github/actions/setup-linux-build-container/action.yml renamed to .github/actions/linux-container-build-setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ runs:
9696
uses: rui314/setup-mold@v1
9797
with:
9898
mold-version: 2.40.4
99-
make-default: false
99+
make-default: true

.github/workflows/ci-linux.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
build:
20-
name: build ${{ matrix.distro.name }} [${{ matrix.compiler }}]
20+
name: build / ${{ matrix.distro.name }} / ${{ matrix.compiler }}
2121
runs-on: ubuntu-latest
2222
timeout-minutes: 45
2323

@@ -39,18 +39,23 @@ jobs:
3939
CMAKE_BUILD_PARALLEL_LEVEL: 4
4040

4141
steps:
42-
- name: Checkout
43-
uses: actions/checkout@v4
44-
with:
45-
fetch-depth: 0
42+
- name: Install Git
43+
shell: bash
44+
run: |
45+
set -euxo pipefail
46+
export DEBIAN_FRONTEND=noninteractive
47+
apt-get -o Acquire::Retries=3 update
48+
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-recommends git ca-certificates
49+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
4650
47-
- uses: ./.github/actions/setup-linux-build-container
51+
- uses: actions/checkout@v4
52+
53+
- uses: ./.github/actions/linux-container-build-setup
4854
with:
4955
compiler: ${{ matrix.compiler }}
5056
update_cmake: ${{ matrix.distro.needs_cmake }}
5157

5258
- name: Configure
53-
shell: bash
5459
run: cmake --preset ci
5560

5661
- name: Build

.github/workflows/ci-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
build:
20-
name: build ${{ matrix.os }} [apple-clang]
20+
name: build / ${{ matrix.os }}
2121
runs-on: ${{ matrix.os }}
2222
timeout-minutes: 45
2323

.github/workflows/code-quality.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ jobs:
2525
- uses: actions/setup-python@v5
2626
with:
2727
python-version: "3.x"
28+
2829
- name: Install pinned clang-format
2930
run: |
3031
python -m pip install --upgrade pip
3132
python -m pip install "clang-format==${CF_VERSION}"
3233
clang-format --version
3334
3435
# Check formatting ONLY for C/C++ files under top-level src/
35-
- name: Check formatting (src/* only)
36+
- name: Run clang-format # src/* only
3637
shell: bash
3738
run: |
3839
git -c core.quotePath=false ls-files -z -- 'src' \
@@ -48,32 +49,37 @@ jobs:
4849
image: ubuntu:24.04
4950

5051
steps:
51-
- name: Checkout
52-
uses: actions/checkout@v4
53-
with:
54-
fetch-depth: 0
52+
- name: Install Git
53+
shell: bash
54+
run: |
55+
set -euxo pipefail
56+
export DEBIAN_FRONTEND=noninteractive
57+
apt-get -o Acquire::Retries=3 update
58+
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-recommends git ca-certificates
59+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
5560
56-
- uses: ./.github/actions/setup-linux-build-container
61+
- uses: actions/checkout@v4
62+
63+
- uses: ./.github/actions/linux-container-build-setup
5764

5865
- uses: actions/setup-python@v5
5966
with:
6067
python-version: "3.x"
68+
6169
- name: Install pinned clang-tidy
6270
run: |
6371
python -m pip install "clang-tidy==${CT_VERSION}"
6472
clang-tidy --version
6573
66-
- name: Configure (dev preset -> compile_commands.json in build/dev/)
74+
- name: Configure # dev preset -> compile_commands.json in build/dev/
6775
run: cmake --preset dev
6876

6977
# Run clang-tidy ONLY for C/C++ sources under top-level src/.
7078
# Header filter also restricted to src/ to avoid build-tree deps.
71-
- name: Run clang-tidy (src/* only)
79+
- name: Run clang-tidy # src/* only
7280
shell: bash
7381
run: |
74-
git -c core.quotePath=false ls-files -z -- 'src' \
75-
| grep -z -E '\.(c|cc|cpp|cxx|m|mm)$' \
76-
| xargs -0 -r -n1 -P"$(nproc)" \
77-
clang-tidy -p build/dev \
78-
--header-filter='(^|.*/)(src)/' \
79-
--warnings-as-errors='*' --
82+
git -c safe.directory="$GITHUB_WORKSPACE" -c core.quotePath=false \
83+
ls-files -z -- 'src' -- '*.c' '*.cc' '*.cpp' '*.cxx' '*.m' '*.mm' \
84+
| xargs -0 -r -n32 -P"$(nproc)" \
85+
clang-tidy -p build/dev --config-file=.clang-tidy -quiet

CMakePresets.json

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,16 @@
4040
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
4141
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
4242
"LLDBG_WITH_IMGUI_DEMO": true,
43-
"LLDBG_WARN_AS_ERRORS": false
44-
}
45-
},
46-
47-
{
48-
"name": "dev-tidy",
49-
"inherits": "dev",
50-
"cacheVariables": {
51-
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;-p=${sourceDir}",
52-
"CMAKE_EXPOSE_COMPILE_COMMANDS": true
43+
"LLDBG_WARN_AS_ERRORS": false,
44+
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": false
5345
}
5446
},
5547

5648
{
5749
"name": "ci",
5850
"displayName": "CI",
5951
"description": "Non-interactive CI build; export compile_commands; warnings-as-errors.",
60-
"inherits": ["ninja-base"],
61-
"cacheVariables": {
62-
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
63-
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
64-
"LLDBG_WITH_IMGUI_DEMO": false,
65-
"LLDBG_WARN_AS_ERRORS": false,
66-
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": false,
67-
"CMAKE_C_FLAGS_RELWITHDEBINFO": "-O0 -g0",
68-
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-O0 -g0"
69-
}
52+
"inherits": ["dev"]
7053
}
7154
],
7255

cmake/LLDBGDeps.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,4 +301,5 @@ get_target_property(_LLDBG_LLDB_INCS lldbg::lldb INTERFACE_INCLUDE_DIRECTORIES)
301301
get_target_property(_LLDBG_LLDB_LIBS lldbg::lldb INTERFACE_LINK_LIBRARIES)
302302
message(STATUS "LLDBG: Using lldbg::lldb")
303303
message(STATUS " includes: ${_LLDBG_LLDB_INCS}")
304-
message(STATUS " link libs: ${_LLDBG_LLDB_LIBS}")
304+
message(STATUS " link libs: ${_LLDBG_LLDB_LIBS}")
305+

0 commit comments

Comments
 (0)