Use simplified FetchContent CI
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This commit is contained in:
parent
4082eb138c
commit
0f507869c4
13
.github/workflows/test.yaml
vendored
13
.github/workflows/test.yaml
vendored
@ -30,19 +30,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/nlohmann/json-ci:v2.4.0
|
||||
steps:
|
||||
- name: Clone nlohmann json version ${{ matrix.json_version }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: nlohmann/json
|
||||
path: nlohmann-json
|
||||
ref: ${{ matrix.json_version }}
|
||||
# TODO: Move to FetchContent managed
|
||||
- name: Build and install nlohmann json
|
||||
run: |
|
||||
cd nlohmann-json
|
||||
cmake -S . -B build
|
||||
cmake --build build --target install -j$(nproc)
|
||||
cd ..
|
||||
- name: Clone json-schema-validator
|
||||
uses: actions/checkout@v3
|
||||
- name: Run CMake ${{ matrix.toolchain }}-ci workflow with nlohmann/json version ${{ matrix.json_version }}
|
||||
|
||||
@ -33,7 +33,13 @@ option(JSON_VALIDATOR_INSTALL "JsonValidator: Install targets" ${PROJECT_IS_TOP_
|
||||
option(JSON_VALIDATOR_BUILD_TESTS "JsonValidator: Build tests" ${PROJECT_IS_TOP_LEVEL})
|
||||
option(JSON_VALIDATOR_BUILD_EXAMPLES "JsonValidator: Build examples" ${PROJECT_IS_TOP_LEVEL})
|
||||
option(JSON_VALIDATOR_SHARED_LIBS "JsonValidator: Build as shared library" ${PROJECT_IS_TOP_LEVEL})
|
||||
set(JSON_FETCH_VERSION v3.11.2 CACHE STRING "Fetch nlohmann::json version")
|
||||
# Get a default JSON_FETCH_VERSION from environment variables to workaround the CI
|
||||
if (DEFINED ENV{NLOHMANN_JSON_VERSION})
|
||||
set(JSON_FETCH_VERSION_DEFAULT $ENV{NLOHMANN_JSON_VERSION})
|
||||
else ()
|
||||
set(JSON_FETCH_VERSION_DEFAULT v3.11.2)
|
||||
endif ()
|
||||
set(JSON_FETCH_VERSION ${JSON_FETCH_VERSION_DEFAULT} CACHE STRING "Fetch nlohmann::json version")
|
||||
|
||||
#[==============================================================================================[
|
||||
# Project configuration #
|
||||
|
||||
Loading…
Reference in New Issue
Block a user