Files
jwt-cpp/.github/workflows/traits.yml
cjserio 65cda08210 Implemented JsonCPP Traits (#317)
* Implemented JsonCPP Traits

* quick pass to add CI

* correct find_packge to use config and not be required

* typo in default version

* jsoncpp forces out of source builds

* disable tests and shared library

* add missing build step

* try a different target + build less 

"they" do not maintain the CMake scripts so this will be fun https://github.com/open-source-parsers/jsoncpp/issues/455#issuecomment-478251641

* fix name for traits (missed replaces)

* Added missing array_type constructor so that basic_claims can be formed from sets of values

* Linters and more tests + fetchcontent gtest

* linter

* support library names with many separators

* linters

* run clang format after rendering defaults

---------

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
2023-12-16 12:27:13 -08:00

86 lines
2.7 KiB
YAML

name: Traits CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
traits:
name: Traits (${{ matrix.target.name }})
runs-on: ubuntu-latest
strategy:
matrix:
target:
- { name: "danielaparker-jsoncons", tag: "0.168.7", version: "v0.168.7" }
- { name: "boost-json", tag: "1.78.0", version: "v1.80.0" }
- { name: "nlohmann-json", tag: "3.11.2", version: "v3.11.2" }
- { name: "kazuho-picojson", tag: "111c9be5188f7350c2eac9ddaedd8cca3d7bf394", version: "111c9be" }
- { name: "open-source-parsers-jsoncpp", tag: "1.9.5", version: "v1.9.5" }
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: setup
run: |
mkdir build
cd build
cmake .. -DJWT_BUILD_EXAMPLES=OFF
sudo cmake --install .
# Install the JSON library
- if: matrix.target.name == 'danielaparker-jsoncons'
uses: ./.github/actions/install/danielaparker-jsoncons
with:
version: ${{matrix.target.tag}}
- if: matrix.target.name == 'boost-json'
uses: ./.github/actions/install/boost-json
with:
version: ${{matrix.target.tag}}
- if: matrix.target.name == 'nlohmann-json'
uses: ./.github/actions/install/nlohmann-json
with:
version: ${{matrix.target.tag}}
- if: matrix.target.name == 'kazuho-picojson'
run: rm -rf include/picojson
- if: matrix.target.name == 'kazuho-picojson'
uses: ./.github/actions/install/kazuho-picojson
with:
version: ${{matrix.target.tag}}
- if: matrix.target.name == 'open-source-parsers-jsoncpp'
uses: ./.github/actions/install/open-source-parsers-jsoncpp
with:
version: ${{matrix.target.tag}}
- name: test
working-directory: example/traits
run: |
cmake . -DCMAKE_FIND_DEBUG_MODE=1
cmake --build . --target ${{ matrix.target.name }}
./${{ matrix.target.name }}
- name: badge success
if: github.event_name == 'push' && success()
uses: ./.github/actions/badge/write
with:
category: traits
label: ${{ matrix.target.name }}
message: ${{ matrix.target.version }}
color: lightblue # turquoise
- name: badge failure
if: github.event_name == 'push' && !success()
uses: ./.github/actions/badge/write
with:
category: traits
label: ${{ matrix.target.name }}
message: ${{ matrix.target.version }}
color: orange
- if: github.event_name == 'push' && always()
uses: ./.github/actions/badge/publish
with:
github_token: ${{ secrets.GITHUB_TOKEN }}