Skip to content

updates from testing cpp-linter/cpp-linter-action#81 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions .github/workflows/cpp-lint-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Cache the build artifacts
id: cache-build
uses: actions/cache@v3
with:
path: build
key: ${{ hashFiles('src/CMakeLists.txt', 'src/demo.cpp', 'src/demo.hpp') }}
submodules: true

# - name: Cache the build artifacts
# id: cache-build
# uses: actions/cache@v3
# with:
# path: build
# key: ${{ hashFiles('src/CMakeLists.txt', 'src/demo.cpp', 'src/demo.hpp') }}

# - name: Generate compilation database
# if: steps.cache-build.outputs.cache-hit != 'true'
# run: mkdir build && cmake -Bbuild src

- name: Generate compilation database
if: steps.cache-build.outputs.cache-hit != 'true'
run: mkdir build && cmake -Bbuild src
# - name: Move database to src folder
# run: mv build/compile_commands.json src/

- name: run linter as action
uses: cpp-linter/cpp-linter-action@latest
Expand All @@ -37,10 +42,10 @@ jobs:
files-changed-only: ${{ matrix.clang-version == '12' }}
# to ignore all build folder contents
ignore: build
database: build
# database: build
verbosity: 9
version: ${{ matrix.clang-version }}
file-annotations: ${{ matrix.clang-version == '12' }}
thread-comments: ${{ matrix.clang-version == '12' }}

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/cpp-lint-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,27 @@ jobs:

strategy:
matrix:
clang-version: ['9','10', '11', '12', '13', '14']
clang-version: ['7', '8', '9','10', '11', '12', '13', '14']
repo: ['cpp-linter/cpp-linter-action']
branch: ['latest']
fail-fast: false

steps:

- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install clang-tools
uses: KyleMayes/install-llvm-action@v1
with:
version: ${{ matrix.clang-version }}
directory: ${{ runner.temp }}/llvm
submodules: true

- uses: actions/setup-python@v4

- name: install workflow deps
run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }}

- name: Install clang-tools
run: clang-tools -install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm

- name: Install linter package
run: python3 -m pip install git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }}
- name: Setup VS dev env
uses: seanmiddleditch/gha-setup-vsdevenv@v4

- name: Cache the build artifacts
id: cache-build
Expand All @@ -36,7 +40,7 @@ jobs:

- name: Generate compiler database
if: steps.cache-build.outputs.cache-hit != 'true'
run: mkdir build && cmake -Bbuild src
run: mkdir build && cmake -Bbuild src -G "NMake Makefiles"

- name: run linter as package
id: linter
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cpp-linter-action"]
path = cpp-linter-action
url = https://github.com/cpp-linter/cpp-linter-action.git
1 change: 1 addition & 0 deletions cpp-linter-action
Submodule cpp-linter-action added at 894a54
1 change: 1 addition & 0 deletions src/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <cstdio>
#include <cstddef>

// using size_t from cstddef
size_t dummyFunc(size_t i) { return i; }

int main()
Expand Down
2 changes: 1 addition & 1 deletion src/demo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ struct LongDiff
{
long diff;

};
};