diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index d0a16da..3ca8d18 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -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 @@ -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 diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 4720c21..dfdf3ea 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -9,7 +9,7 @@ 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 @@ -17,15 +17,19 @@ jobs: 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 @@ -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 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..bddf44e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cpp-linter-action"] + path = cpp-linter-action + url = https://github.com/cpp-linter/cpp-linter-action.git diff --git a/cpp-linter-action b/cpp-linter-action new file mode 160000 index 0000000..894a549 --- /dev/null +++ b/cpp-linter-action @@ -0,0 +1 @@ +Subproject commit 894a54988abed9f2c7a37f5b54694e819de7f462 diff --git a/src/demo.cpp b/src/demo.cpp index 8a4a9ed..0c1db60 100644 --- a/src/demo.cpp +++ b/src/demo.cpp @@ -3,6 +3,7 @@ #include #include +// using size_t from cstddef size_t dummyFunc(size_t i) { return i; } int main() diff --git a/src/demo.hpp b/src/demo.hpp index 505b6b7..2695731 100644 --- a/src/demo.hpp +++ b/src/demo.hpp @@ -38,4 +38,4 @@ struct LongDiff { long diff; -}; \ No newline at end of file +};