ci: Rework macos workflows

This commit is contained in:
Corentin Le Molgat
2022-08-29 11:47:31 +02:00
parent fda295e6b3
commit c2f360eadb
4 changed files with 82 additions and 78 deletions

View File

@@ -3,31 +3,31 @@ name: CMake MacOS C++
on: [push, pull_request]
jobs:
cmake_make:
# Building using the github runner environement directly.
macos:
runs-on: macos-latest
strategy:
matrix:
build: [
["Xcode", "Release", "ALL_BUILD", "RUN_TESTS", "install"],
["Unix Makefiles", "Release", "all", "test", "install"]
]
fail-fast: false
env:
GENERATOR: ${{ matrix.build[0] }}
BUILD_TYPE: ${{ matrix.build[1] }}
BUILD_TARGET: ${{ matrix.build[2] }}
TEST_TARGET: ${{ matrix.build[3] }}
INSTALL_TARGET: ${{ matrix.build[4] }}
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_DEPS=ON
run: cmake -S. -Bbuild -G "$GENERATOR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=install -DBUILD_DEPS=ON
- name: Build
run: cmake --build build --target all -v
run: cmake --build build --config "$BUILD_TYPE" --target "$BUILD_TARGET" -v
- name: Test
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test -v
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --config "$BUILD_TYPE" --target "$TEST_TARGET" -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
cmake_xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_DEPS=ON
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
run: cmake --build build --config Release --target RUN_TESTS -v
- name: Install
run: cmake --build build --config Release --target install -v -- DESTDIR=install
run: cmake --build build --config "$BUILD_TYPE" --target "$INSTALL_TARGET" -v

View File

@@ -4,8 +4,21 @@ on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake_make:
macos:
runs-on: macos-latest
strategy:
matrix:
build: [
["Xcode", "Release", "ALL_BUILD", "RUN_TESTS", "install"],
["Unix Makefiles", "Release", "all", "test", "install"]
]
fail-fast: false
env:
GENERATOR: ${{ matrix.build[0] }}
BUILD_TYPE: ${{ matrix.build[1] }}
BUILD_TARGET: ${{ matrix.build[2] }}
TEST_TARGET: ${{ matrix.build[3] }}
INSTALL_TARGET: ${{ matrix.build[4] }}
steps:
- uses: actions/checkout@v2
- name: Swig install
@@ -26,10 +39,13 @@ jobs:
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_DOTNET=ON -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
run: >
cmake -S. -Bbuild -G "$GENERATOR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=install
-DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
-DBUILD_DOTNET=ON
- name: Build
run: cmake --build build --target all -v
run: cmake --build build --config "$BUILD_TYPE" --target "$BUILD_TARGET" -v
- name: Test
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test -v
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --config "$BUILD_TYPE" --target "$TEST_TARGET" -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
run: cmake --build build --config "$BUILD_TYPE" --target "$INSTALL_TARGET" -v

View File

@@ -4,8 +4,21 @@ on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake_make:
macos:
runs-on: macos-latest
strategy:
matrix:
build: [
["Xcode", "Release", "ALL_BUILD", "RUN_TESTS", "install"],
["Unix Makefiles", "Release", "all", "test", "install"]
]
fail-fast: false
env:
GENERATOR: ${{ matrix.build[0] }}
BUILD_TYPE: ${{ matrix.build[1] }}
BUILD_TARGET: ${{ matrix.build[2] }}
TEST_TARGET: ${{ matrix.build[3] }}
INSTALL_TARGET: ${{ matrix.build[4] }}
steps:
- uses: actions/checkout@v2
- name: Swig install
@@ -17,32 +30,13 @@ jobs:
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_JAVA=ON -DSKIP_GPG=ON -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
run: >
cmake -S. -Bbuild -G "$GENERATOR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=install
-DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
-DBUILD_JAVA=ON -DSKIP_GPG=ON
- name: Build
run: cmake --build build --target all -v
run: cmake --build build --config "$BUILD_TYPE" --target "$BUILD_TARGET" -v
- name: Test
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test -v
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --config "$BUILD_TYPE" --target "$TEST_TARGET" -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
cmake_xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Check java
run: java -version
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_JAVA=ON -DSKIP_GPG=ON -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
# note: can't use the target RUN_TESTS which seems to conflict with maven run command
#run: cmake --build build --config Release --target RUN_TESTS -v
run: cd build && ctest -C Release --verbose --extra-verbose --output-on-failure
- name: Install
run: cmake --build build --config Release --target install -v -- DESTDIR=install
run: cmake --build build --config "$BUILD_TYPE" --target "$INSTALL_TARGET" -v

View File

@@ -4,8 +4,21 @@ on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake_make:
macos:
runs-on: macos-latest
strategy:
matrix:
build: [
["Xcode", "Release", "ALL_BUILD", "RUN_TESTS", "install"],
["Unix Makefiles", "Release", "all", "test", "install"]
]
fail-fast: false
env:
GENERATOR: ${{ matrix.build[0] }}
BUILD_TYPE: ${{ matrix.build[1] }}
BUILD_TARGET: ${{ matrix.build[2] }}
TEST_TARGET: ${{ matrix.build[3] }}
INSTALL_TARGET: ${{ matrix.build[4] }}
steps:
- uses: actions/checkout@v2
- name: Swig install
@@ -17,32 +30,13 @@ jobs:
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON=ON -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
run: >
cmake -S. -Bbuild -G "$GENERATOR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=install
-DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
-DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --target all -v
run: cmake --build build --config "$BUILD_TYPE" --target "$BUILD_TARGET" -v
- name: Test
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test -v
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --config "$BUILD_TYPE" --target "$TEST_TARGET" -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
cmake_xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Update Path
run: echo "$HOME/Library/Python/3.9/bin" >> $GITHUB_PATH
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_PYTHON=ON -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
# note: can't use the target RUN_TESTS which seems to conflict with maven run command
#run: cmake --build build --config Release --target RUN_TESTS -v
run: cd build && ctest -C Release --verbose --extra-verbose --output-on-failure
- name: Install
run: cmake --build build --config Release --target install -v -- DESTDIR=install
run: cmake --build build --config "$BUILD_TYPE" --target "$INSTALL_TARGET" -v