diff --git a/.github/workflows/self-test.yml b/.github/workflows/self-test.yml new file mode 100644 index 00000000..bcecf604 --- /dev/null +++ b/.github/workflows/self-test.yml @@ -0,0 +1,58 @@ +name: Self test action + +on: + push: + branches: main + paths-ignore: "docs/**" + pull_request: + branches: main + paths-ignore: "docs/**" + +jobs: + test: + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + clang-version: ['9','10', '11', '12', '13', '14', '15', '16', '17', '18'] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache the build artifacts + id: cache-build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ hashFiles('docs/examples/demo/CMakeLists.txt', 'docs/examples/demo/demo.cpp', 'docs/examples/demo/demo.hpp') }} + + - name: Generate compilation database + if: steps.cache-build.outputs.cache-hit != 'true' + run: mkdir build && cmake -Bbuild docs/examples/demo + + - name: Self test action + uses: ./ + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: file + files-changed-only: false + # to ignore all build folder contents + ignore: build + database: build + verbosity: 9 + version: ${{ matrix.clang-version }} + thread-comments: ${{ matrix.clang-version == '12' }} + file-annotations: ${{ matrix.clang-version == '12' }} + extra-args: -std=c++14 -Wall + + - name: Fail fast?! + # if: steps.linter.outputs.checks-failed > 0 + run: | + echo "some linter checks failed" + echo "${{ steps.linter.outputs.checks-failed }}" + echo "${{ env.checks-failed }}" + # for actual deployment + # run: exit 1 \ No newline at end of file diff --git a/docs/examples/demo/CMakeLists.txt b/docs/examples/demo/CMakeLists.txt new file mode 100644 index 00000000..ab7721fe --- /dev/null +++ b/docs/examples/demo/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.15) + +# Set the project name to your project name +project(demo C CXX) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +add_executable(demo_app + ${CMAKE_BINARY_SOURCE_DIR}demo.hpp + ${CMAKE_BINARY_SOURCE_DIR}demo.cpp +) +target_include_directories(demo_app PUBLIC ${CMAKE_BINARY_SOURCE_DIR})