mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
🪞 Add support for reflect-cpp's JSON (#421)
* 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>
This commit is contained in:
12
.github/actions/install/reflectcpp-json/action.yml
vendored
Normal file
12
.github/actions/install/reflectcpp-json/action.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
name: Install reflect-cpp
|
||||
description: Install reflect-cpp for building test application
|
||||
inputs:
|
||||
version:
|
||||
description: The desired reflect-cpp version to install
|
||||
required: false
|
||||
default: "0.24.0"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- run: ${{ github.action_path }}/install-reflect-cpp.sh ${{ inputs.version }}
|
||||
shell: bash
|
||||
48
.github/actions/install/reflectcpp-json/install-reflect-cpp.sh
vendored
Executable file
48
.github/actions/install/reflectcpp-json/install-reflect-cpp.sh
vendored
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install reflect-cpp library with specified version
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
# Check if version is provided
|
||||
if [[ -z "$1" ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
|
||||
echo "Usage: $0 VERSION"
|
||||
echo ""
|
||||
echo "Install reflect-cpp library"
|
||||
echo ""
|
||||
echo "Arguments:"
|
||||
echo " VERSION reflect-cpp version to install (required)"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 0.24.0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Configuration
|
||||
reflectcpp_VERSION="$1"
|
||||
INSTALL_DIR="/tmp"
|
||||
BUILD_DIR="${INSTALL_DIR}/reflect-cpp-${reflectcpp_VERSION}"
|
||||
|
||||
echo "Installing reflectcpp v${reflectcpp_VERSION}..."
|
||||
|
||||
# Download
|
||||
echo "Downloading reflectcpp v${reflectcpp_VERSION}..."
|
||||
cd "${INSTALL_DIR}"
|
||||
wget -q "https://github.com/getml/reflect-cpp/archive/v${reflectcpp_VERSION}.tar.gz"
|
||||
|
||||
# Extract
|
||||
echo "Extracting archive..."
|
||||
tar -zxf "v${reflectcpp_VERSION}.tar.gz"
|
||||
|
||||
# Build and install
|
||||
echo "Building and installing..."
|
||||
cd "${BUILD_DIR}"
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DREFLECTCPP_INSTALL=ON
|
||||
cmake --build .
|
||||
sudo cmake --install .
|
||||
|
||||
# Cleanup
|
||||
echo "Cleaning up..."
|
||||
rm -f "${INSTALL_DIR}/v${reflectcpp_VERSION}.tar.gz"
|
||||
rm -rf "${BUILD_DIR}"
|
||||
|
||||
echo "✓ reflect-cpp v${reflectcpp_VERSION} installed successfully!"
|
||||
2
.github/workflows/jwt.yml
vendored
2
.github/workflows/jwt.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
- uses: ./.github/actions/install/boost-json
|
||||
- uses: ./.github/actions/install/open-source-parsers-jsoncpp
|
||||
- uses: ./.github/actions/install/glaze-json
|
||||
|
||||
- uses: ./.github/actions/install/reflectcpp-json
|
||||
|
||||
- name: Configure LCOV to ignore mismatches
|
||||
# https://github.com/linux-test-project/lcov/issues/316#issuecomment-2304694266
|
||||
|
||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -72,6 +72,7 @@ jobs:
|
||||
- { 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
|
||||
@@ -102,6 +103,7 @@ jobs:
|
||||
- { 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
|
||||
|
||||
6
.github/workflows/traits.yml
vendored
6
.github/workflows/traits.yml
vendored
@@ -22,6 +22,7 @@ jobs:
|
||||
- { name: "kazuho-picojson", tag: "111c9be5188f7350c2eac9ddaedd8cca3d7bf394", version: "111c9be" }
|
||||
- { name: "open-source-parsers-jsoncpp", tag: "1.9.6", version: "v1.9.6" }
|
||||
- { name: "glaze-json", tag: "7.0.2", version: "v7.0.2" }
|
||||
- { name: "reflectcpp-json", tag: "0.24.0", version: "v0.24.0" }
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: lukka/get-cmake@latest
|
||||
@@ -65,6 +66,11 @@ jobs:
|
||||
with:
|
||||
version: ${{matrix.target.tag}}
|
||||
|
||||
- if: matrix.target.name == 'reflectcpp-json'
|
||||
uses: ./.github/actions/install/reflectcpp-json
|
||||
with:
|
||||
version: ${{ matrix.target.tag }}
|
||||
|
||||
- name: test
|
||||
working-directory: example/traits
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user