mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-26 18:15:40 +00:00
Update c-cpp.yml
This commit is contained in:
parent
4bc17b6b81
commit
418e97d258
64
.github/workflows/c-cpp.yml
vendored
64
.github/workflows/c-cpp.yml
vendored
@ -2,32 +2,60 @@ name: C/C++ CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ "main" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
env:
|
|
||||||
BUILD_TYPE: Release
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_cmake:
|
build:
|
||||||
name: CMake Build & Test
|
name: CMake Build & Test
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest, windows-latest]
|
||||||
build_type: [Release]
|
build_type: [Release, Debug]
|
||||||
|
c_compiler: [gcc, clang, cl]
|
||||||
runs-on: ${{ matrix.os }}
|
include:
|
||||||
|
- os: windows-latest
|
||||||
|
c_compiler: cl
|
||||||
|
cpp_compiler: cl
|
||||||
|
- os: ubuntu-latest
|
||||||
|
c_compiler: gcc
|
||||||
|
cpp_compiler: g++
|
||||||
|
- os: ubuntu-latest
|
||||||
|
c_compiler: clang
|
||||||
|
cpp_compiler: clang++
|
||||||
|
exclude:
|
||||||
|
- os: windows-latest
|
||||||
|
c_compiler: gcc
|
||||||
|
- os: windows-latest
|
||||||
|
c_compiler: clang
|
||||||
|
- os: ubuntu-latest
|
||||||
|
c_compiler: cl
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Configure CMake
|
|
||||||
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DELFIO_BUILD_EXAMPLES=YES -DELFIO_BUILD_TESTS=YES
|
- name: Set reusable strings
|
||||||
- name: Build
|
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
|
||||||
run: cmake --build build --config ${{ matrix.build_type }}
|
id: strings
|
||||||
- name: Test
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd build
|
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
|
||||||
ctest -C ${{ matrix.build_type }}
|
|
||||||
cd ..
|
- name: Configure CMake
|
||||||
|
run: >
|
||||||
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}
|
||||||
|
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
|
||||||
|
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
|
||||||
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
|
||||||
|
-DELFIO_BUILD_EXAMPLES=YES -DELFIO_BUILD_TESTS=YES
|
||||||
|
-S ${{ github.workspace }}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
working-directory: ${{ steps.strings.outputs.build-output-dir }}
|
||||||
|
run: ctest --build-config ${{ matrix.build_type }}
|
||||||
|
Loading…
Reference in New Issue
Block a user