-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaa1ce7
commit 44e53dc
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}) |