json/.github/workflows/macos.yml

68 lines
1.7 KiB
YAML
Raw Normal View History

2020-05-12 20:30:11 +02:00
name: macOS
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:
xcode_1:
runs-on: macos-11
2021-03-28 13:37:04 +02:00
strategy:
matrix:
xcode: ['11.7', '12.4', '12.5.1', '13.0']
2021-03-28 13:37:04 +02:00
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
2021-05-29 13:10:28 +02:00
steps:
- uses: actions/checkout@v3
- name: Run CMake
2021-05-29 13:10:28 +02:00
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: Build
2021-05-29 13:10:28 +02:00
run: cmake --build build --parallel 10
- name: Test
2021-05-29 13:10:28 +02:00
run: cd build ; ctest -j 10 --output-on-failure
xcode_2:
runs-on: macos-12
strategy:
matrix:
2022-12-04 14:03:54 +01:00
xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- uses: actions/checkout@v3
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 --output-on-failure
2021-05-29 13:10:28 +02:00
xcode_standards:
runs-on: macos-latest
2021-05-29 13:10:28 +02:00
strategy:
matrix:
2023-05-21 17:23:18 +02:00
standard: [11, 14, 17, 20, 23]
2021-05-29 13:10:28 +02:00
steps:
- uses: actions/checkout@v3
- name: Run CMake
Improve unit testing (Part 1) (#3380) * Refactor unit test creation Add functions for creating tests and to supply test- and standard-specific build settings. Raises minimum CMake version to 3.13 in test directory. json_test_add_test_for( <file> MAIN <main> [CXX_STANDARDS <version_number>...] [FORCE]) Given a <file> unit-foo.cpp, produces test-foo_cpp<version_number> if C++ standard <version_number> is supported by the compiler and thesource file contains JSON_HAS_CPP_<version_number>. Use FORCE to create the test regardless of the file containing JSON_HAS_CPP_<version_number>. Test targets are linked against <main>. CXX_STANDARDS defaults to "11". json_test_set_test_options( all|<tests> [CXX_STANDARDS all|<args>...] [COMPILE_DEFINITIONS <args>...] [COMPILE_FEATURES <args>...] [COMPILE_OPTIONS <args>...] [LINK_LIBRARIES <args>...] [LINK_OPTIONS <args>...]) Supply test- and standard-specific build settings. Specify multiple tests using a list e.g., "test-foo;test-bar". Must be called BEFORE the test is created. * Use CMAKE_MODULE_PATH * Don't undef some macros if JSON_TEST_KEEP_MACROS is defined * Use JSON_TEST_KEEP_MACROS Incidentally enables the regression tests for #2546 and #3070. A CHECK_THROWS_WITH_AS in #3070 was disabled which is tracked in #3377 and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE. * Add three-way comparison feature test macro * Disable broken comparison if JSON_HAS_THREE_WAY_COMPARISON * Fix redefinition of inline constexpr statics Redelcaration of inline constexpr static data members in namespace scope was deprecated in C++17. Fixes -Werror=deprecated compilation failures. * Fix more test build failures due to missing noexcept * CI: update cmake_flags test to use CMake 3.13 in test directory Also change default for JSON_BuildTests option to depend on CMake version. * CI: turn *_CXXFLAGS into CMake lists * CI: use JSON_TestStandards to set CXX_STANDARD * CI: pass extra CXXFLAGS to standards tests
2022-03-24 07:54:07 +01:00
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_TestStandards=${{ matrix.standard }}
- name: Build
2021-03-28 13:37:04 +02:00
run: cmake --build build --parallel 10
- name: Test
2021-03-28 13:37:04 +02:00
run: cd build ; ctest -j 10 --output-on-failure