Skip to content

Commit 0dda711

Browse files
committed
Run clang-tidy only on ubuntu in CI
1 parent 3e509e6 commit 0dda711

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

.github/workflows/ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v1
4141

42+
- name: Install clang-tidy
43+
if: matrix.os == 'ubuntu'
44+
run: sudo apt-get install clang-tidy -y -q
45+
4246
- uses: actions/setup-python@v2
4347
with: { python-version: "3.8" }
4448

@@ -84,6 +88,10 @@ jobs:
8488
steps:
8589
- uses: actions/checkout@v1
8690

91+
- name: Install clang-tidy
92+
if: matrix.os == 'ubuntu'
93+
run: sudo apt-get install clang-tidy -y -q
94+
8795
- uses: actions/setup-python@v2
8896
with: { python-version: "3.8" }
8997

cmake-init/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def ask(*args, **kwargs):
123123
header="This will require you to download clang-tidy locally.",
124124
) == "y",
125125
"examples": False,
126-
"os": "windows" if os.name == "nt" else "unix",
126+
"os": "win64" if os.name == "nt" else "unix",
127127
}
128128
d["uc_name"] = d["name"].upper().replace("-", "_")
129129
if d["type_id"] != "e":

cmake-init/templates/common/.github/workflows/ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ jobs:
6161
steps:
6262
- uses: actions/checkout@v1
6363

64+
- name: Install clang-tidy
65+
if: matrix.os == 'ubuntu'
66+
run: sudo apt-get install clang-tidy -y -q
67+
6468
- name: Configure
6569
run: cmake --preset=ci-${{ matrix.os }}{type shared}
6670
-D BUILD_SHARED_LIBS=${{ matrix.shared }}{end}

cmake-init/templates/common/CMakePresets.json

+10-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@
3737
"name": "ci-unix",
3838
"generator": "Unix Makefiles",
3939
"hidden": true,
40-
"inherits": ["flags-unix", "ci-build", "clang-tidy"],
40+
"inherits": ["flags-unix", "ci-build"],
4141
"cacheVariables": {
4242
"CMAKE_BUILD_TYPE": "Release"
4343
}
4444
},
45+
{
46+
"name": "ci-win64",
47+
"inherits": ["flags-windows", "ci-build"],
48+
"generator": "Visual Studio 16 2019",
49+
"architecture": "x64",
50+
"hidden": true
51+
},
4552
{
4653
"name": "ci-coverage",
4754
"inherits": "ci-unix",
@@ -58,13 +65,11 @@
5865
},
5966
{
6067
"name": "ci-ubuntu",
61-
"inherits": "ci-unix"
68+
"inherits": ["ci-unix", "clang-tidy"]
6269
},
6370
{
6471
"name": "ci-windows",
65-
"inherits": ["flags-windows", "ci-build", "clang-tidy"],
66-
"generator": "Visual Studio 16 2019",
67-
"architecture": "x64"
72+
"inherits": "ci-win64"
6873
}
6974
]
7075
}

0 commit comments

Comments
 (0)