mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
* adding clang-tidy and asan tests Playing with clang-tidy, we already had the rule removed in #166... running the static analyzer from CMake reproduced the report in many places... I suspect the macro and `new`/`delete` separation clang-tidy is just unable to understand. Running the problematic examples + tests with the ASAN enabled reported no problems * Apply suggestions from code review * Update lint.yml * applying linting rules * fix bad rename * formating * clang-tidy on jsoncons tests * and cmake-format to lint * cmake format improve change detection * Update lint.yml * apply linting
83 lines
2.2 KiB
YAML
83 lines
2.2 KiB
YAML
name: Lint CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
clang-format:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
files: ["include/jwt-cpp/*.h", "tests/**.cpp"]
|
|
steps:
|
|
- run: sudo apt-get install clang-format
|
|
- uses: actions/checkout@v2
|
|
- run: clang-format -i ${{ matrix.files }}
|
|
- run: exit $(git status -s | wc -l)
|
|
|
|
cmake-format:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
files: ["CMakeLists.txt", "**/CMakeLists.txt", "cmake/code-coverage.cmake"]
|
|
steps:
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.x'
|
|
- run: pip install cmakelang
|
|
- uses: actions/checkout@v2
|
|
- run: ls ${{ matrix.files }}
|
|
- run: cmake-format --check $(ls ${{ matrix.files }})
|
|
|
|
clang-tidy:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- run: sudo apt-get install clang-tidy
|
|
- uses: actions/checkout@v2
|
|
- uses: lukka/get-cmake@latest
|
|
- uses: ./.github/actions/install/gtest
|
|
|
|
- name: configure
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake .. -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-fix"
|
|
|
|
- name: run
|
|
run: |
|
|
cd build
|
|
make
|
|
- run: exit $(git status -s | wc -l)
|
|
|
|
asan: ## Based on https://gist.github.com/jlblancoc/44be9d4d466f0a973b1f3808a8e56782
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: lukka/get-cmake@latest
|
|
- uses: ./.github/actions/install/gtest
|
|
|
|
- name: configure
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake .. -DJWT_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=leak -g" \
|
|
-DCMAKE_C_FLAGS="-fsanitize=address -fsanitize=leak -g" \
|
|
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address -fsanitize=leak" \
|
|
-DCMAKE_MODULE_LINKER_FLAGS="-fsanitize=address -fsanitize=leak"
|
|
|
|
- name: build
|
|
run: |
|
|
cd build
|
|
make
|
|
|
|
- name: run
|
|
run: |
|
|
export ASAN_OPTIONS=fast_unwind_on_malloc=0
|
|
cd build
|
|
./example/rsa-create
|
|
./example/rsa-verify
|
|
./tests/jwt-cpp-test
|