mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
* add reflect json traits * jwt-cpp defaults * fix clang tidy warnings * fix clang tidy warnings * rename directory * add tests * add tests * add tests * replace unnecessary copy with move * gate reflect cpp tests behind flag * reflect cpp CI work * reflect-cpp example * reflect-cpp CI * reflect-cpp CI * match naming + update ci * first pass code review * linter * linter * align naming * make file +x * align target name fix order or targets in tests * fix typo * Fix target_link_libraries syntax for jwt-cpp * cleanup example code * add reflect-json to coverage tests --------- Co-authored-by: Ali Girayhan Ozbay <aligirayhan.ozbay@abex.capital> Co-authored-by: Ali Girayhan Özbay <aligirayhan@ozbay.org>
131 lines
4.7 KiB
YAML
131 lines
4.7 KiB
YAML
name: Lint CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
clang-format:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
files:
|
|
- "include/jwt-cpp/*.h"
|
|
- "include/jwt-cpp/traits/**/*.h"
|
|
- "tests/*.cpp"
|
|
- "tests/**/*.cpp"
|
|
- "example/*.cpp"
|
|
- "example/**/*.cpp"
|
|
steps:
|
|
- run: |
|
|
sudo apt-get install clang-format-14
|
|
shopt -s globstar
|
|
- uses: actions/checkout@v4
|
|
- run: clang-format-14 -i ${{ matrix.files }}
|
|
- uses: ./.github/actions/process-linting-results
|
|
with:
|
|
linter_name: clang-format
|
|
|
|
cmake-format:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
files: ["**/CMakeLists.txt", "cmake/code-coverage.cmake"]
|
|
steps:
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
- run: pip install cmakelang
|
|
- run: shopt -s globstar
|
|
- uses: actions/checkout@v4
|
|
- run: cmake-format -i ${{ matrix.files }}
|
|
- uses: ./.github/actions/process-linting-results
|
|
with:
|
|
linter_name: cmake-format
|
|
|
|
clang-tidy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: lukka/get-cmake@latest
|
|
- uses: actions/checkout@v4
|
|
- name: configure
|
|
run: cmake --preset examples -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-fix"
|
|
- name: run
|
|
run: cmake --build --preset examples
|
|
- uses: ./.github/actions/process-linting-results
|
|
with:
|
|
linter_name: clang-tidy
|
|
|
|
render-defaults:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
traits:
|
|
- { name: "boost_json", library: "Boost.JSON", url: "https://github.com/boostorg/json", disable_pico: true }
|
|
- { name: "danielaparker_jsoncons", library: "jsoncons", url: "https://github.com/danielaparker/jsoncons", disable_pico: true }
|
|
- { name: "kazuho_picojson", library: "picojson", url: "https://github.com/kazuho/picojson", disable_pico: false }
|
|
- { name: "nlohmann_json", library: "JSON for Modern C++", url: "https://github.com/nlohmann/json", disable_pico: true }
|
|
- { name: "open_source_parsers_jsoncpp", library: "jsoncpp", url: "https://github.com/open-source-parsers/jsoncpp", disable_pico: true }
|
|
- { name: "glaze_json", library: "Glaze", url: "https://github.com/stephenberry/glaze", disable_pico: true }
|
|
- { name: "reflectcpp_json", library: "ReflectCpp", url: "https://github.com/getml/reflect-cpp", disable_pico: true }
|
|
name: render-defaults (${{ matrix.traits.name }})
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: |
|
|
sudo apt-get install clang-format-14
|
|
- uses: ./.github/actions/render/defaults
|
|
id: render
|
|
with:
|
|
traits_name: ${{ matrix.traits.name }}
|
|
library_name: ${{ matrix.traits.library }}
|
|
library_url: ${{ matrix.traits.url }}
|
|
disable_default_traits: ${{ matrix.traits.disable_pico }}
|
|
- run: clang-format-14 -i ${{ steps.render.outputs.file_path }}
|
|
- run: git add ${{ steps.render.outputs.file_path }}
|
|
- uses: ./.github/actions/process-linting-results
|
|
with:
|
|
linter_name: render-defaults
|
|
|
|
render-tests:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
traits:
|
|
# - { name: "boost_json", suite: "BoostJsonTest" } # Currently needs work around for API limitations
|
|
- { name: "danielaparker_jsoncons", suite: "JsonconsTest" }
|
|
# - { name: "kazuho_picojson", suite: "PicoJsonTest" } # Currently the default everything tests against this!
|
|
- { name: "nlohmann_json", suite: "NlohmannTest" }
|
|
- { name: "open_source_parsers_jsoncpp", suite: "OspJsoncppTest" }
|
|
# - { name: "glaze_json", suite: "GlazeTest" } # No supported due to istream buffer being specialized
|
|
# - { name: "reflectcpp_json", suite: "ReflectCppJsonTest" } # No supported due to istream buffer being specialized
|
|
name: render-tests (${{ matrix.traits.name }})
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: |
|
|
sudo apt-get install clang-format-14
|
|
shopt -s globstar
|
|
- uses: ./.github/actions/render/tests
|
|
with:
|
|
traits_name: ${{ matrix.traits.name }}
|
|
test_suite_name: ${{ matrix.traits.suite }}
|
|
- run: clang-format-14 -i tests/**/*.cpp
|
|
- run: git add tests/traits/*
|
|
- uses: ./.github/actions/process-linting-results
|
|
with:
|
|
linter_name: render-tests
|
|
|
|
line-ending:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: git add --renormalize .
|
|
- uses: ./.github/actions/process-linting-results
|
|
with:
|
|
linter_name: line-ending
|