From 7a29c390c3f4adb6063789f81fdc000b5873d46c Mon Sep 17 00:00:00 2001 From: DockedFerret800 Date: Fri, 24 Apr 2026 19:00:48 +0100 Subject: [PATCH 1/4] CI Co-authored-by: Copilot --- .github/workflows/modules.yml | 54 ++++++++++++++++++++++++++++++++++ CMakePresets.json | 55 +++++++++++++++++++++++++++++++++++ README.md | 2 +- docs/install.md | 2 +- 4 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/modules.yml diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml new file mode 100644 index 000000000..5475f8948 --- /dev/null +++ b/.github/workflows/modules.yml @@ -0,0 +1,54 @@ +name: Build & Test with modules + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + release: + types: [published] + +jobs: + build: + name: ${{ matrix.runs_on }}-${{ matrix.compiler }}-${{ matrix.configure_preset }} + runs-on: ${{ matrix.runs_on }} + strategy: + fail-fast: false + matrix: + include: + - runs_on: windows-2025-vs2026 + compiler: msvc-14.50 + configure_preset: "x64-vs-modules" + build_preset: "x64-vs-modules-build" + test_preset : "x64-vs-modules-test" + # To be uncommented once GitHub Actions adds GCC 15 with Ubuntu 26 + # - runs_on: ubuntu-latest + # compiler: gcc-15 + # configure_preset: "linux-debug" + # build_preset: "linux-debug-build" + # test_preset : "linux-debug-test" + - runs_on: ubuntu-latest + compiler: clang-18 + cc: clang + cxx: clang++ + configure_preset: "linux-debug-modules" + build_preset: "linux-debug-modules-build" + test_preset : "linux-debug-modules-test" + steps: + + - uses: actions/checkout@v6 + + - uses: lukka/get-cmake@latest + + - name: "Build & Test" + uses: lukka/run-cmake@v10 + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + with: + configurePreset: ${{ matrix.configure_preset }} + buildPreset: ${{ matrix.build_preset }} + testPreset: ${{ matrix.test_preset }} \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json index acac67081..997ceb8de 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -21,6 +21,45 @@ "JWT_BUILD_EXAMPLES": "ON", "JWT_BUILD_TESTS": "ON" } + }, + { + "name": "windows-vs-base", + "hidden": true, + "generator": "Visual Studio 18 2026", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "x64-vs-modules", + "displayName": "x64 (VS generator) with Modules", + "inherits": "windows-vs-base", + "architecture": "x64", + "cacheVariables": { + "JWT_ENABLE_MODULES": "ON", + "JWT_USE_IMPORT_STD": "ON" + } + }, + { + "name": "linux-debug-modules", + "displayName": "Linux Debug with Modules", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "JWT_ENABLE_MODULES": "ON", + "JWT_USE_IMPORT_STD": "ON" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } } ], "buildPresets": [ @@ -28,6 +67,14 @@ "name": "dev", "configurePreset": "dev", "configuration": "Debug" + }, + { + "name": "x64-vs-modules-build", + "configurePreset": "x64-vs-modules" + }, + { + "name": "linux-debug-modules-build", + "configurePreset": "linux-debug-modules" } ], "testPresets": [ @@ -35,6 +82,14 @@ "name": "dev", "displayName": "Run all tests", "configurePreset": "dev" + }, + { + "name": "x64-vs-modules-test", + "configurePreset": "x64-vs-modules" + }, + { + "name": "linux-debug-modules-test", + "configurePreset": "linux-debug-modules" } ] } \ No newline at end of file diff --git a/README.md b/README.md index 452810ccb..80aa26dc2 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ If you are looking to issue or verify more unique tokens, checkout out the [exam Building on the goal of providing flexibility. #### Modules support -jwt-cpp supports C++20/23 modules. There are two configuration options `JWT_ENABLE_MODULES` to enable modules (С++20) and `JWT_USE_IMPORT_STD` to use `import std` (С++23). +jwt-cpp supports C++20/23 modules. There are two configuration options: `JWT_ENABLE_MODULES` to enable modules (С++20) and `JWT_USE_IMPORT_STD` to use `import std` (С++23). CMake example: ```cmake set(JWT_ENABLE_MODULES ON) diff --git a/docs/install.md b/docs/install.md index 5215045ea..28220b2f6 100644 --- a/docs/install.md +++ b/docs/install.md @@ -9,7 +9,7 @@ It's strongly recommended to use a package manager, as JWT-CPP has dependencies When manually adding this dependency, and the dependencies this has, check the GitHub Actions and Workflows for some inspiration about how to go about it. #### Modules support -jwt-cpp supports C++20/23 modules. There are two configuration options `JWT_ENABLE_MODULES` to enable modules (С++20) and `JWT_USE_IMPORT_STD` to use `import std` (С++23). +jwt-cpp supports C++20/23 modules. There are two configuration options: `JWT_ENABLE_MODULES` to enable modules (С++20) and `JWT_USE_IMPORT_STD` to use `import std` (С++23). CMake example: ```cmake set(JWT_ENABLE_MODULES ON) From 6f1b38a47c35f47ac34e91913a040b46dfe846d8 Mon Sep 17 00:00:00 2001 From: DockedFerret800 Date: Fri, 24 Apr 2026 19:03:45 +0100 Subject: [PATCH 2/4] Build examples Co-authored-by: Copilot --- .github/workflows/modules.yml | 22 ++++++++++++---------- CMakePresets.json | 6 ++++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index 5475f8948..d386a5114 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -1,15 +1,17 @@ name: Build & Test with modules -on: - push: - branches: - - main - pull_request: - branches: - - main - workflow_dispatch: - release: - types: [published] +on: + push: + branches: [master] + pull_request: + branches: [master] + paths: + - "CMakeLists.txt" + - "cmake/**" + - "include/jwt-cpp/**" + - "tests/cmake/**" + - ".github/actions/**" + - ".github/workflows/cmake.yml" jobs: build: diff --git a/CMakePresets.json b/CMakePresets.json index 997ceb8de..8463236f1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -41,7 +41,8 @@ "architecture": "x64", "cacheVariables": { "JWT_ENABLE_MODULES": "ON", - "JWT_USE_IMPORT_STD": "ON" + "JWT_USE_IMPORT_STD": "ON", + "JWT_BUILD_EXAMPLES": "ON" } }, { @@ -53,7 +54,8 @@ "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", "JWT_ENABLE_MODULES": "ON", - "JWT_USE_IMPORT_STD": "ON" + "JWT_USE_IMPORT_STD": "ON", + "JWT_BUILD_EXAMPLES": "ON" }, "condition": { "type": "equals", From 88d047a6d8e08313d7260ed243a680ae60aa554b Mon Sep 17 00:00:00 2001 From: DockedFerret800 Date: Fri, 24 Apr 2026 19:07:59 +0100 Subject: [PATCH 3/4] test --- .github/workflows/modules.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index d386a5114..7ddc34dc5 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -4,14 +4,6 @@ on: push: branches: [master] pull_request: - branches: [master] - paths: - - "CMakeLists.txt" - - "cmake/**" - - "include/jwt-cpp/**" - - "tests/cmake/**" - - ".github/actions/**" - - ".github/workflows/cmake.yml" jobs: build: From 95fac1a2c6964fece5b80bc79269691e81aa43b7 Mon Sep 17 00:00:00 2001 From: DockedFerret800 Date: Fri, 24 Apr 2026 19:11:17 +0100 Subject: [PATCH 4/4] Disable Clang --- .github/workflows/modules.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index 7ddc34dc5..361e5689c 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -4,6 +4,14 @@ on: push: branches: [master] pull_request: + branches: [master] + paths: + - "CMakeLists.txt" + - "cmake/**" + - "include/jwt-cpp/**" + - "tests/cmake/**" + - ".github/actions/**" + - ".github/workflows/cmake.yml" jobs: build: @@ -24,13 +32,13 @@ jobs: # configure_preset: "linux-debug" # build_preset: "linux-debug-build" # test_preset : "linux-debug-test" - - runs_on: ubuntu-latest - compiler: clang-18 - cc: clang - cxx: clang++ - configure_preset: "linux-debug-modules" - build_preset: "linux-debug-modules-build" - test_preset : "linux-debug-modules-test" + # - runs_on: ubuntu-latest + # compiler: clang-18 + # cc: clang + # cxx: clang++ + # configure_preset: "linux-debug-modules" + # build_preset: "linux-debug-modules-build" + # test_preset : "linux-debug-modules-test" steps: - uses: actions/checkout@v6