CI: updated CMake to version 3.28.1 #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macOS | |
on: | |
- push | |
- pull_request | |
env: | |
CMAKE_VERSION: 3.28.1 | |
jobs: | |
build: | |
name: ${{matrix.config.os}} - Xcode ${{matrix.config.xcode}} - ${{matrix.build_type}} | |
runs-on: ${{matrix.config.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: [ | |
# {os: macos-11, xcode: 11.7}, | |
# {os: macos-11, xcode: 12.4}, | |
{os: macos-11, xcode: 12.5.1}, | |
# {os: macos-11, xcode: 13.0}, | |
# {os: macos-11, xcode: 13.1}, | |
# {os: macos-11, xcode: 13.2}, | |
{os: macos-11, xcode: 13.2.1} | |
] | |
build_type: [Debug, Release, Sanitize] | |
steps: | |
- name: Checkout dynamic_bitset | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
path: dynamic_bitset | |
- name: Setup build environment | |
shell: cmake -P {0} | |
run: | | |
file(APPEND "$ENV{GITHUB_ENV}" "CMAKE_GENERATOR=Xcode\n") | |
file(APPEND "$ENV{GITHUB_ENV}" "DEVELOPER_DIR=/Applications/Xcode_${{matrix.config.xcode}}.app/Contents/Developer\n") | |
- name: Setup CMake | |
id: cmake | |
uses: ./dynamic_bitset/.github/actions/setup_cmake | |
with: | |
cmake_version: ${{env.CMAKE_VERSION}} | |
used_env: ${{matrix.config.os}} | |
- name: Configure | |
shell: cmake -P {0} | |
run: | | |
file(TO_CMAKE_PATH [=[${{github.workspace}}]=] workspace) | |
execute_process( | |
COMMAND ${{steps.cmake.outputs.cmake_binary}} | |
-S "${workspace}/dynamic_bitset" | |
-B "${workspace}/dynamic_bitset/build" | |
-D CMAKE_CONFIGURATION_TYPES=${{matrix.build_type}} | |
-D CMAKE_BUILD_TYPE=${{matrix.build_type}} | |
RESULT_VARIABLE result | |
) | |
if(NOT result EQUAL 0) | |
message(FATAL_ERROR "Bad exit status") | |
endif() | |
- name: Build | |
shell: cmake -P {0} | |
run: | | |
file(TO_CMAKE_PATH [=[${{github.workspace}}]=] workspace) | |
include(ProcessorCount) | |
ProcessorCount(N) | |
execute_process( | |
COMMAND ${{steps.cmake.outputs.cmake_binary}} | |
--build "${workspace}/dynamic_bitset/build" | |
--config ${{matrix.build_type}} | |
--parallel ${N} | |
RESULT_VARIABLE result | |
) | |
if(NOT result EQUAL 0) | |
message(FATAL_ERROR "Bad exit status") | |
endif() | |
- name: Run tests | |
shell: cmake -P {0} | |
run: | | |
file(TO_CMAKE_PATH [=[${{github.workspace}}]=] workspace) | |
include(ProcessorCount) | |
ProcessorCount(N) | |
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON") | |
execute_process( | |
COMMAND ${{steps.cmake.outputs.ctest_binary}} --output-on-failure --parallel ${N} | |
WORKING_DIRECTORY "${workspace}/dynamic_bitset/build" | |
RESULT_VARIABLE result | |
) | |
if(NOT result EQUAL 0) | |
message(FATAL_ERROR "Running tests failed!") | |
endif() |