name: "json4cpp: CI" on: push: branches: - develop - master - release/* paths: - 'json4cpp/**' - '.github/workflows/json4cpp-ci.yml' pull_request: paths: - 'json4cpp/**' - '.github/workflows/json4cpp-ci.yml' workflow_dispatch: permissions: contents: read concurrency: group: json4cpp-${{ 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@v6 - name: Get latest CMake and ninja uses: lukka/get-cmake@v4 - name: Run CMake run: cmake -S json4cpp -B build -DJSON_CI=On - name: Build run: cmake --build build --target ci_test_gcc ci_static_analysis: runs-on: ubuntu-latest strategy: fail-fast: false 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: - uses: actions/checkout@v6 - name: Install Valgrind run: sudo apt-get update ; sudo apt-get install -y valgrind - name: Get latest CMake and ninja uses: lukka/get-cmake@v4 - name: Run CMake run: cmake -S json4cpp -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: fail-fast: false matrix: target: [ci_test_clang, ci_clang_tidy, ci_test_clang_sanitizer, ci_clang_analyze, ci_single_binaries] steps: - name: Install dependencies run: apt-get update ; apt-get install -y git clang-tools iwyu unzip - uses: actions/checkout@v6 - name: Get latest CMake and ninja uses: lukka/get-cmake@v4 - name: Run CMake run: cmake -S json4cpp -B build -DJSON_CI=On - name: Build run: cmake --build build --target ${{ matrix.target }} ci_test_compilers_gcc: runs-on: ubuntu-latest strategy: fail-fast: false matrix: compiler: ['7', '8', '9', '10', '11', '12', '13', '14', '15', 'latest'] container: gcc:${{ matrix.compiler }} steps: - uses: actions/checkout@v6 - name: Get latest CMake and ninja uses: lukka/get-cmake@v4 - name: Run CMake run: cmake -S json4cpp -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: fail-fast: false matrix: compiler: ['11', '12', '13', '14', '15-bullseye', '16', '17', '18', '19', '20', 'latest'] container: silkeh/clang:${{ matrix.compiler }} steps: - uses: actions/checkout@v6 - name: Get latest CMake and ninja uses: lukka/get-cmake@v4 - name: Run CMake run: cmake -S json4cpp -B build -DJSON_CI=On - name: Build run: cmake --build build --target ci_test_compiler_default ci_test_coverage: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y build-essential cmake lcov ninja-build locales gcc-multilib g++-multilib sudo locale-gen de_DE sudo update-locale - name: Run CMake run: cmake -S json4cpp -B build -DJSON_CI=On - name: Build run: cmake --build build --target ci_test_coverage - name: Upload coverage report uses: actions/upload-artifact@v7 with: name: code-coverage-report path: build/html macos: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [macos-13, macos-14, macos-15] steps: - uses: actions/checkout@v6 - name: Run CMake run: cmake -S json4cpp -B build -DJSON_CI=On - name: Build run: cmake --build build --target ci_test_clang windows: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [windows-2022, windows-2025] steps: - uses: actions/checkout@v6 - name: Run CMake run: cmake -S json4cpp -B build -DJSON_CI=On -G "Visual Studio 17 2022" - name: Build run: cmake --build build --config Release --target ci_test_msvc codeql: runs-on: ubuntu-latest permissions: security-events: write steps: - uses: actions/checkout@v6 - name: Initialize CodeQL uses: github/codeql-action/init@v4 with: languages: cpp - name: Build run: | cmake -S json4cpp -B build cmake --build build - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4