mirror of
https://github.com/nlohmann/json.git
synced 2026-09-23 16:30:31 +00:00
* test: cover JSON_NO_IO, JSON_THROW/TRY/CATCH_USER, JSON_SKIP_LIBRARY_VERSION_CHECK, and JSON_DisableEnumSerialization in CI (#5423) These four supported configuration macros were never actually compiled anywhere in the test matrix: - JSON_NO_IO and the JSON_THROW_USER/JSON_TRY_USER/JSON_CATCH_USER trio are exercised together in a new tests/src/unit-no_io_and_user_exceptions.cpp, which is automatically picked up by the existing unit-*.cpp test glob and thus built across the whole standard test matrix. - JSON_SKIP_LIBRARY_VERSION_CHECK is exercised by a new, dedicated tests/src/skip_library_version_check.cpp, compiled directly by the new ci_test_skiplibraryversioncheck target in cmake/ci.cmake: the scenario it simulates (mixing two differently-versioned inclusions of the library) unavoidably triggers the compiler's own "macro redefined" warning, which would fail under the library's own -Weverything/-Werror unit test matrix for a reason unrelated to the macro under test. - JSON_DisableEnumSerialization already had #if-guarded tests in several unit-*.cpp files (from #4384), but no CMake target ever actually set the JSON_DisableEnumSerialization CMake option, so that guarded code was never compiled. Add ci_test_disableenumserialization, mirroring the existing ci_test_noimplicitconversions/ci_test_noglobaludls targets. Building the full test suite with this option on surfaced one real, narrow gap: get<T>() on std::vector<std::byte> (used by unit-regression2.cpp's custom BinaryType tests) relies on std::byte being handled via enum serialization, so add the same #if-guard convention to the two affected SECTIONs there. Both new CI targets are added to the ci_cmake_options matrix in .github/workflows/ubuntu.yml, alongside the existing ci_test_* targets. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * test: cover multi-digit widths and bare alignment in std::formatter<json> (#5423) Every existing std::formatter spec with a width used a single digit (e.g. "{:2}"), so the width-parsing loop's accumulation of a second/third digit was never exercised; add multi-digit width cases. Likewise, every existing spec with an alignment character also had an explicit fill character, so the bare-alignment branch (e.g. "{:<}", with no fill) was never exercised; add cases asserting it keeps the default space indent character. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * test: add coverage for patch_inplace() (#5423) patch_inplace() had no unit test at all. Add a happy-path case mirroring an existing patch() example, and -- more importantly -- pin its distinguishing contract versus patch(): when a multi-operation JSON Patch fails partway through, patch_inplace() (which mutates the document directly, operation by operation) leaves whatever operations already succeeded applied, whereas patch() (which applies the patch to an internal copy that is discarded on exception) leaves the original completely untouched either way. Verified empirically against the current implementation before writing the assertions. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * test: fix duplicate TEST_CASE name in unit-no-mem-leak-on-adl-serialize.cpp (#5423) Two distinct TEST_CASEs were both named "check_for_mem_leak_on_adl_to_json-2". doctest allows duplicate names, so both still ran, but it makes --test-case=<name> filtering and reporting ambiguous. Rename the second one to "-3", continuing the existing "-1"/"-2" sequence. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * test: add direct coverage for the std::u8string to_json overload (#5423) The ADL to_json overload for std::basic_string<char8_t, ...> was only ever reached indirectly, via std::filesystem::path::u8string(). Add a test that constructs a json value directly from a std::u8string, gated the same way as the overload itself (include/nlohmann/detail/conversions/to_json.hpp): behind both the std::filesystem::path feature guard and __cpp_lib_char8_t, since the overload only exists when both are satisfied. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * test: verify move semantics of byte_container_with_subtype's rvalue constructors (#5423) The two rvalue-reference constructors were never distinguished from their const-lvalue-reference twins by any test. Add a "move semantics" section that constructs from an rvalue std::vector, checks the resulting container keeps the exact same buffer address as the source (a stronger check than just observing the source ended up empty, since a copy-then-clear could do that too), and confirms the source vector was left empty. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Guard patch_inplace() partial-application test against JSON_NOEXCEPTION The "distinguishing contract vs patch(): partial application on failure" test relies on doc.patch_inplace(patch) actually throwing so the partially-applied state can be observed right after the throw point. Under ci_test_noexceptions, JSON_THROW() calls std::abort() instead of throwing, and doctest's --no-throw test filter (which that CI job passes) makes CHECK_THROWS_AS() a no-op that never even evaluates its expression -- so patch_inplace() is never called and the follow-up assertions fail against the untouched original document. Guard the whole SECTION with #if !defined(JSON_NOEXCEPTION), following the same convention already used elsewhere in the test suite (e.g. unit-class_parser.cpp) for exception-dependent tests. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Fix MSVC C2220 in the std::u8string conversion test MSVC's C5321 ("nonstandard extension used: encoding '\xNN' as a multi-byte utf-8 character") is promoted to a hard error by our MSVC CI configs. It fires because the test composed a non-ASCII UTF-8 sequence inside a u8"" literal using raw \x byte escapes; MSVC treats that as nonstandard and suggests using \u universal-character-names instead, which every compiler agrees on and which compiles down to the exact same encoded bytes. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Guard the JSON_THROW_USER test against JSON_NOEXCEPTION and GCC's -Wunused-result Two independent CI configurations failed to build/run this new test: - ci_test_noexceptions runs the whole suite with -DJSON_NOEXCEPTION and doctest's "--no-throw" filter, which compiles CHECK_THROWS_AS() down to a no-op that never even invokes the guarded expression. Since this test's whole point is to observe json_throw_user_call_count after json::parse()/at() actually throw, it can't be meaningfully run under that filter (our JSON_THROW_USER override still throws real exceptions regardless of JSON_NOEXCEPTION, but the assertion never gets a chance to run). Guard the TEST_CASE with #if !defined(JSON_NOEXCEPTION), mirroring the existing precedent in unit-json_patch.cpp. - ci_test_gcc and ci_test_standards_gcc(11) failed with -Werror=unused-result on the discarded json::parse() return value. json::parse() is marked warn_unused_result, and unlike a real [[nodiscard]] attribute, GCC does not consider that satisfied by doctest's (void)-cast around the expression in C++11 mode. Assign the result to a discarded local instead, matching the established `json _ = json::parse(...)` idiom already used throughout unit-class_parser.cpp. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Suppress a clang-tidy false positive on an intentional defensive copy performance-unnecessary-copy-initialization suggests copy_for_patch could be a reference since it's never modified -- but the copy is the point: it guards against a hypothetical regression where patch() mutates its receiver, which a reference could never catch (the follow-up assertion would just compare `original` to itself). Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Fix clang-tidy findings in the JSON_NO_IO/JSON_THROW_USER test - bugprone-macro-parentheses: wrap the JSON_THROW_USER macro argument in parentheses at the throw site. - modernize-raw-string-literal: switch two escaped JSON string literals to raw string literals. Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
406 lines
16 KiB
YAML
406 lines
16 KiB
YAML
name: Ubuntu
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
- master
|
|
- release/*
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
ci_test_gcc:
|
|
runs-on: ubuntu-latest
|
|
container: gcc:latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_test_gcc
|
|
|
|
ci_infer:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Install Infer
|
|
run: |
|
|
wget -q -O - "https://github.com/facebook/infer/releases/download/v1.3.0/infer-linux-x86_64-v1.3.0.tar.xz" | sudo tar -C /opt -xJ
|
|
sudo ln -s /opt/infer-linux-x86_64-v1.3.0/bin/infer /usr/local/bin/infer
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_infer
|
|
|
|
ci_static_analysis_ubuntu:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target: [ci_test_amalgamation, ci_test_single_header, ci_cppcheck, ci_cpplint, ci_reproducible_tests, ci_non_git_tests, ci_offline_testdata, ci_reuse_compliance, ci_test_valgrind]
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Install Valgrind
|
|
run: sudo apt-get update ; sudo apt-get install -y valgrind
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ${{ matrix.target }}
|
|
|
|
ci_static_analysis_clang:
|
|
runs-on: ubuntu-latest
|
|
container: silkeh/clang:dev
|
|
strategy:
|
|
matrix:
|
|
target: [ci_test_clang, ci_clang_tidy, ci_test_clang_sanitizer, ci_clang_analyze, ci_single_binaries]
|
|
steps:
|
|
- name: Install git, clang-tools, iwyu (ci_single_binaries), and unzip
|
|
run: apt-get update ; apt-get install -y git clang-tools iwyu unzip
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ${{ matrix.target }}
|
|
|
|
ci_cmake_options:
|
|
runs-on: ubuntu-latest
|
|
container: ubuntu:focal
|
|
strategy:
|
|
matrix:
|
|
target: [ci_cmake_flags, ci_test_diagnostics, ci_test_diagnostic_positions, ci_test_noexceptions, ci_test_noimplicitconversions, ci_test_legacycomparison, ci_test_noglobaludls, ci_test_disableenumserialization, ci_test_skiplibraryversioncheck, ci_test_simdutf]
|
|
steps:
|
|
- name: Install build-essential
|
|
run: apt-get update ; apt-get install -y build-essential unzip wget git libssl-dev
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ${{ matrix.target }}
|
|
|
|
ci_test_coverage:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install dependencies and de_DE locale
|
|
run: |
|
|
sudo apt-get clean
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential cmake lcov ninja-build make locales gcc-multilib g++-multilib
|
|
sudo locale-gen de_DE
|
|
sudo update-locale
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_test_coverage
|
|
- name: Archive coverage report
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: code-coverage-report
|
|
path: ${{ github.workspace }}/build/html
|
|
- name: Publish report to Coveralls
|
|
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
path-to-lcov: ${{ github.workspace }}/build/json.info.filtered.noexcept
|
|
fail-on-error: false
|
|
|
|
ci_test_compilers_gcc_old:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
compiler: ['4.8', '4.9', '5', '6']
|
|
# official gcc:4.8/4.9/5/6 images fail to check out code (too old for
|
|
# actions/checkout); install the old compilers on top of official ubuntu:20.04
|
|
# instead, mirroring what the (now retired) custom json-ci image did.
|
|
container: ubuntu:20.04
|
|
steps:
|
|
- name: Install g++-${{ matrix.compiler }}
|
|
run: |
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends software-properties-common ca-certificates gnupg make git
|
|
# add-apt-repository resolves the PPA through the Launchpad API,
|
|
# which intermittently times out or fails the team lookup (the plain
|
|
# "deb ..." sources below never hit Launchpad and never flake).
|
|
# Retry with backoff so a transient Launchpad blip does not fail CI.
|
|
for attempt in 1 2 3 4 5; do
|
|
add-apt-repository -y ppa:ubuntu-toolchain-r/test && break
|
|
echo "::warning::add-apt-repository ppa:ubuntu-toolchain-r/test failed (attempt ${attempt}/5); retrying"
|
|
sleep $((attempt * 10))
|
|
done
|
|
apt-add-repository -y "deb http://archive.ubuntu.com/ubuntu/ bionic main"
|
|
apt-add-repository -y "deb http://archive.ubuntu.com/ubuntu/ bionic universe"
|
|
apt-add-repository -y "deb http://archive.ubuntu.com/ubuntu/ xenial main"
|
|
apt-add-repository -y "deb http://archive.ubuntu.com/ubuntu/ xenial universe"
|
|
apt-add-repository -y "deb http://archive.ubuntu.com/ubuntu/ xenial-updates main"
|
|
apt-add-repository -y "deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe"
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends g++-${{ matrix.compiler }}
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: CXX=g++-${{ matrix.compiler }} cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_test_compiler_g++-${{ matrix.compiler }}
|
|
|
|
ci_test_compilers_gcc:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
# older GCC docker images (4, 5, 6) fail to check out code
|
|
compiler: ['7', '8', '9', '10', '11', '12', '13', '14', '15', 'latest']
|
|
container: gcc:${{ matrix.compiler }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_test_compiler_default
|
|
|
|
ci_test_compilers_clang:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
compiler: ['3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15-bullseye', '16', '17', '18', '19', '20', '21', '22', 'latest']
|
|
container: silkeh/clang:${{ matrix.compiler }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Set env FORCE_STDCPPFS_FLAG for clang 7 / 8 / 9 / 10
|
|
run: echo "JSON_FORCED_GLOBAL_COMPILE_OPTIONS=-DJSON_HAS_FILESYSTEM=0;-DJSON_HAS_EXPERIMENTAL_FILESYSTEM=0" >> "$GITHUB_ENV"
|
|
if: ${{ matrix.compiler == '7' || matrix.compiler == '8' || matrix.compiler == '9' || matrix.compiler == '10' }}
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_test_compiler_default
|
|
|
|
ci_test_standards_gcc:
|
|
runs-on: ubuntu-latest
|
|
container: gcc:latest
|
|
strategy:
|
|
matrix:
|
|
standard: [11, 14, 17, 20, 23, 26]
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_test_gcc_cxx${{ matrix.standard }}
|
|
|
|
ci_test_standards_clang:
|
|
runs-on: ubuntu-latest
|
|
container: silkeh/clang:latest
|
|
strategy:
|
|
matrix:
|
|
standard: [11, 14, 17, 20, 23, 26]
|
|
stdlib: [libcxx, libstdcxx]
|
|
steps:
|
|
- name: Install git and unzip
|
|
run: apt-get update ; apt-get install -y git unzip
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build with libc++
|
|
run: cmake --build build --target ci_test_clang_libcxx_cxx${{ matrix.standard }}
|
|
if: ${{ matrix.stdlib == 'libcxx' }}
|
|
- name: Build with libstdc++
|
|
run: cmake --build build --target ci_test_clang_cxx${{ matrix.standard }}
|
|
if: ${{ matrix.stdlib == 'libstdcxx' }}
|
|
|
|
ci_cuda_example:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# 11.8.0: newest pre-C++20 CUDA release, exercises the C++17 fallback
|
|
# path (tests/cuda_example/CMakeLists.txt picks the standard per nvcc
|
|
# version); 12.1.1: permanent regression guard for #3907 (nvcc 12.0/12.1
|
|
# choke on enable_borrowed_range at C++20, fixed in 12.2); 12.6.3: recent
|
|
# CUDA/C++20 coverage.
|
|
cuda: ['11.8.0', '12.1.1', '12.6.3']
|
|
container: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu22.04
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_cuda_example
|
|
|
|
ci_module_cpp20:
|
|
strategy:
|
|
matrix:
|
|
container: ['gcc:latest', 'silkeh/clang:latest']
|
|
runs-on: ubuntu-latest
|
|
container: ${{ matrix.container }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
# The module test uses `import std;`, which needs CMake's experimental
|
|
# import-std support. Its opt-in token is CMake-version-specific, so pin
|
|
# CMake to the version whose token is set in tests/module_cpp20/CMakeLists.txt.
|
|
- name: Get pinned CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
with:
|
|
cmakeVersion: 4.3.4
|
|
# Clang: the std library module is provided by libc++ (the image's libstdc++
|
|
# ships none), and the image's libc++ module manifest has a broken relative
|
|
# path — repoint it at the real module sources.
|
|
- name: Use libc++ and fix its module manifest path (Clang)
|
|
if: matrix.container == 'silkeh/clang:latest'
|
|
run: |
|
|
echo "CXXFLAGS=-stdlib=libc++" >> "$GITHUB_ENV"
|
|
mkdir -p /usr/lib/share && ln -sf /usr/lib/llvm-*/share/libc++ /usr/lib/share/libc++
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_module_cpp20
|
|
|
|
ci_icpc:
|
|
runs-on: ubuntu-latest
|
|
# Intel discontinued the classic icc/icpc compiler in oneAPI 2024.0; this is
|
|
# Intel's own last officially published image that still includes it.
|
|
container: intel/oneapi-hpckit:2023.2.1-devel-ubuntu22.04
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
# No need to source setvars.sh here: unlike the old custom image, this
|
|
# official image already has the oneAPI environment (icc/icpc on PATH)
|
|
# baked in, and re-sourcing it fails with "already been run" (exit 3).
|
|
run: cmake --build build --target ci_icpc
|
|
|
|
ci_icpx:
|
|
runs-on: ubuntu-latest
|
|
container: intel/oneapi-hpckit:latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_icpx
|
|
|
|
ci_nvhpc:
|
|
runs-on: ubuntu-latest
|
|
container: nvcr.io/nvidia/nvhpc:25.5-devel-cuda12.9-ubuntu22.04
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ci_nvhpc
|
|
|
|
ci_emscripten:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Install emscripten
|
|
uses: mymindstorm/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get latest CMake and ninja
|
|
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -GNinja
|
|
- name: Build
|
|
run: cmake --build build
|
|
|
|
ci_test_documentation:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target: [ci_test_examples, ci_test_build_documentation]
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Run CMake
|
|
run: cmake -S . -B build -DJSON_CI=On
|
|
- name: Build
|
|
run: cmake --build build --target ${{ matrix.target }}
|