[MDAPI-246][С++] Build a project with statically linked runtime libraries. #816
Workflow file for this run
This file contains hidden or 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
# Copyright (c) 2025 Devexperts LLC. | |
# SPDX-License-Identifier: MPL-2.0 | |
name: CI | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
config: | |
- name: win-vs2022 | |
image: windows-latest | |
os: windows | |
cores: 4 | |
cc: 'cl' | |
cxx: 'cl' | |
- name: macos-13-xcode-15 | |
image: macos-13 | |
os: macos | |
cores: 4 | |
xcode: '15.0' | |
cc: 'clang' | |
cxx: 'clang++' | |
- name: ubuntu-24.04-clang-18 | |
image: ubuntu-24.04 | |
os: linux | |
cores: 4 | |
cc: 'clang-18' | |
cxx: 'clang++-18' | |
- name: ubuntu-24.04-gcc-14 | |
image: ubuntu-24.04 | |
os: linux | |
cores: 4 | |
cc: 'gcc-14' | |
cxx: 'g++-14' | |
- name: ubuntu-24.04-gcc-12 | |
image: ubuntu-24.04 | |
os: linux | |
cores: 4 | |
cc: 'gcc-12' | |
cxx: 'g++-12' | |
# - name: ubuntu-22.04-gcc-9 | |
# image: ubuntu-22.04 | |
# os: linux | |
# cores: 4 | |
# cc: 'gcc-9' | |
# cxx: 'g++-9' | |
- name: ubuntu-22.04-gcc-11 | |
image: ubuntu-22.04 | |
os: linux | |
cores: 4 | |
cc: 'gcc-11' | |
cxx: 'g++-11' | |
- name: macos-14-xcode-15 | |
image: macos-14 | |
os: macos | |
cores: 3 | |
xcode: '15.0' | |
cc: 'clang' | |
cxx: 'clang++' | |
buildType: [ Release, Debug, RelWithDebInfo ] | |
sanitizers: [ NO_SAN, ASAN, UBSAN ] | |
name: "${{ matrix.config.name }}-${{matrix.buildType}}-${{matrix.sanitizers}}" | |
runs-on: ${{ matrix.config.image }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode version | |
if: ${{ contains(matrix.config.os, 'macos') }} | |
run: sudo xcode-select -s '/Applications/Xcode_${{matrix.config.xcode}}.app/Contents/Developer' | |
- name: Prepare build | |
run: | | |
ls | |
mkdir ${{github.workspace}}/build | |
- name: Prepare build (Win MT) | |
if: ${{ contains(matrix.config.os, 'win') }} | |
run: | | |
ls | |
mkdir ${{github.workspace}}/build-mt | |
- name: Configure CMake | |
if: ${{ contains(matrix.config.os, 'mac') }} | |
run: > | |
cmake -B ${{github.workspace}}/build | |
-DCMAKE_BUILD_TYPE=${{matrix.buildType}} | |
-DCMAKE_C_COMPILER=${{matrix.config.cc}} | |
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} | |
-DDXFCXX_BUILD_DOC=OFF | |
-DDXFCXX_FEATURE_STACKTRACE=ON | |
-DDXFCXX_ENABLE_${{matrix.sanitizers}}=ON | |
- name: Configure CMake | |
if: ${{ contains(matrix.config.os, 'linux') }} | |
run: > | |
cmake -B ${{github.workspace}}/build | |
-DCMAKE_BUILD_TYPE=${{matrix.buildType}} | |
-DCMAKE_C_COMPILER=${{matrix.config.cc}} | |
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} | |
-DDXFCXX_BUILD_DOC=OFF | |
-DDXFCXX_FEATURE_STACKTRACE=ON | |
-DDXFCXX_ENABLE_${{matrix.sanitizers}}=ON | |
- name: Configure CMake | |
if: ${{ contains(matrix.config.os, 'win') }} | |
run: > | |
cmake -B ${{github.workspace}}/build | |
-DCMAKE_BUILD_TYPE=${{matrix.buildType}} | |
-DDXFCXX_BUILD_DOC=OFF | |
-DDXFCXX_FEATURE_STACKTRACE=ON | |
- name: Configure CMake (Win MT) | |
if: ${{ contains(matrix.config.os, 'win') }} | |
run: > | |
cmake -B ${{github.workspace}}/build-mt | |
-DCMAKE_BUILD_TYPE=${{matrix.buildType}} | |
-DDXFCXX_BUILD_DOC=OFF | |
-DDXFCXX_FEATURE_STACKTRACE=ON | |
-DDXFCXX_LINK_STATIC_RUNTIME=ON | |
- name: Build | |
if: ${{ !contains(matrix.config.os, 'win') }} | |
run: > | |
cmake --build ${{github.workspace}}/build --config ${{matrix.buildType}} -j ${{matrix.config.cores}} | |
- name: Build | |
if: ${{ contains(matrix.config.os, 'win') }} | |
run: > | |
cmake --build ${{github.workspace}}/build --config ${{matrix.buildType}} -j ${{matrix.config.cores}} | |
-- | |
/p:CL_MPCount=${{matrix.config.cores}} | |
- name: Build (Win MT) | |
if: ${{ contains(matrix.config.os, 'win') }} | |
run: > | |
cmake --build ${{github.workspace}}/build-mt --config ${{matrix.buildType}} -j ${{matrix.config.cores}} | |
-- | |
/p:CL_MPCount=${{matrix.config.cores}} | |
- name: Test | |
if: ${{ ! cancelled() }} | |
continue-on-error: true | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.buildType}} --extra-verbose --output-on-failure --parallel ${{matrix.config.cores}} |