Skip to content

Commit 3f86baa

Browse files
authored
Update CI workflows (#49)
* use a container on Linux runner - nushell requires GLIBC (libc6) v2.32-2.35 or later - install lsb-release (required by LLVM script) - also ensure cmake and compilers are availalbe - disable checkout of submodules when using a container * revise "Fail fast?!" step * add clang v19 and v20 to CI matrix * conform `thread-comments` and `file-annotations` values.
1 parent c19bb3d commit 3f86baa

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

.github/workflows/cpp-lint-action.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ ubuntu-latest, macos-latest, windows-latest ]
13-
clang-version: ['9','10', '11', '12', '13', '14', '15', '16', '17', '18']
13+
clang-version: ['9','10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']
1414
fail-fast: false
1515

1616
runs-on: ${{ matrix.os }}
17+
container: ${{ matrix.os == 'ubuntu-latest' && 'ubuntu:latest' || '' }}
1718
steps:
1819
- uses: actions/checkout@v5
1920
with:
20-
submodules: true
21+
submodules: ${{ matrix.os != 'ubuntu-latest' }}
2122
repository: cpp-linter/test-cpp-linter-action
2223

2324
- name: Cache the build artifacts
@@ -27,12 +28,17 @@ jobs:
2728
path: build
2829
key: ${{ runner.os }}-${{ hashFiles('src/CMakeLists.txt', 'src/demo.cpp', 'src/demo.hpp') }}
2930

31+
- name: Install necessary Linux tools
32+
if: matrix.os == 'ubuntu-latest'
33+
run: >-
34+
apt-get update &&
35+
apt-get install -y libc6 cmake gcc g++ wget lsb-release
3036
- name: Generate compilation database
3137
if: steps.cache-build.outputs.cache-hit != 'true'
3238
run: mkdir build && cmake -Bbuild src
3339

3440
- name: Run linter as action
35-
uses: cpp-linter/cpp-linter-action@latest
41+
uses: cpp-linter/cpp-linter-action@main
3642
id: linter
3743
env:
3844
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -42,17 +48,18 @@ jobs:
4248
# to ignore all build folder contents
4349
ignore: build
4450
database: build
45-
verbosity: 9
51+
verbosity: debug
4652
version: ${{ matrix.clang-version }}
47-
thread-comments: ${{ matrix.clang-version == '12' }}
48-
file-annotations: ${{ matrix.clang-version == '12' }}
53+
thread-comments: ${{ matrix.clang-version == '17' && 'update' }}
54+
file-annotations: ${{ matrix.clang-version == '17' }}
4955
extra-args: -std=c++14 -Wall
5056

5157
- name: Fail fast?!
5258
# if: steps.linter.outputs.checks-failed > 0
53-
run: |
59+
run: |
5460
echo "some linter checks failed"
55-
echo "${{ steps.linter.outputs.checks-failed }}"
56-
echo "${{ env.checks-failed }}"
61+
echo "total: ${{ steps.linter.outputs.checks-failed }}"
62+
echo "clang-format: ${{ steps.linter.outputs.clang-format-checks-failed }}"
63+
echo "clang-tidy: ${{ steps.linter.outputs.clang-tidy-checks-failed }}"
5764
# for actual deployment
5865
# run: exit 1

.github/workflows/cpp-lint-package.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
clang-version: ['7', '8', '9','10', '11', '12', '13', '14', '15', '16', '17']
17+
clang-version: ['9','10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']
1818
repo: ['cpp-linter/cpp-linter']
1919
branch: ['${{ inputs.branch }}']
2020
fail-fast: false
@@ -69,6 +69,10 @@ jobs:
6969
7070
- name: Fail fast?!
7171
if: steps.linter.outputs.checks-failed > 0
72-
run: echo "Some files failed the linting checks!"
72+
run: |
73+
echo "some linter checks failed"
74+
echo "total: ${{ steps.linter.outputs.checks-failed }}"
75+
echo "clang-format: ${{ steps.linter.outputs.clang-format-checks-failed }}"
76+
echo "clang-tidy: ${{ steps.linter.outputs.clang-tidy-checks-failed }}"
7377
# for actual deployment
7478
# run: exit 1

0 commit comments

Comments
 (0)