From 72f869f96b922f2d5aa86e97cc29a4fc4ba3918e Mon Sep 17 00:00:00 2001 From: FranckRJ Date: Sun, 27 Aug 2023 12:02:23 +0200 Subject: [PATCH] Made the CI a bit more uniform. --- .github/workflows/ci_linux_clang.yml | 2 +- .github/workflows/ci_linux_gcc.yml | 2 +- .github/workflows/ci_macos_appleclang.yml | 68 +++++++++++++++++++++++ .github/workflows/ci_windows_msvc.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/macos.yml | 44 --------------- .gitignore | 5 ++ 7 files changed, 77 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/ci_macos_appleclang.yml delete mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/ci_linux_clang.yml b/.github/workflows/ci_linux_clang.yml index 2f9298ec..2c6529f5 100644 --- a/.github/workflows/ci_linux_clang.yml +++ b/.github/workflows/ci_linux_clang.yml @@ -90,4 +90,4 @@ jobs: cmake --build build -j - name: Run tests run: | - build/tests/FakeIt_tests + ctest --test-dir build/ --verbose diff --git a/.github/workflows/ci_linux_gcc.yml b/.github/workflows/ci_linux_gcc.yml index d772e7d5..e5468ea0 100644 --- a/.github/workflows/ci_linux_gcc.yml +++ b/.github/workflows/ci_linux_gcc.yml @@ -84,4 +84,4 @@ jobs: cmake --build build -j - name: Run tests run: | - build/tests/FakeIt_tests + ctest --test-dir build/ --verbose diff --git a/.github/workflows/ci_macos_appleclang.yml b/.github/workflows/ci_macos_appleclang.yml new file mode 100644 index 00000000..617c51f5 --- /dev/null +++ b/.github/workflows/ci_macos_appleclang.yml @@ -0,0 +1,68 @@ +name: CI macOS/AppleClang + +on: + push: + pull_request: + +defaults: + run: + shell: bash + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - { + name: "macOS 11 AppleClang 13", + os: macos-11, + build_type: Debug, + cxx_standard: 17 + } + - { + name: "macOS 13 AppleClang 14 C++11", + os: macos-13, + build_type: Debug, + cxx_standard: 11 + } + - { + name: "macOS 13 AppleClang 14 C++14", + os: macos-13, + build_type: Debug, + cxx_standard: 14 + } + - { + name: "macOS 13 AppleClang 14 C++17", + os: macos-13, + build_type: Debug, + cxx_standard: 17 + } + - { + name: "macOS 13 AppleClang 14 C++20", + os: macos-13, + build_type: Debug, + cxx_standard: 20 + } + - { + name: "macOS 13 AppleClang with sanitizers", + os: macos-13, + build_type: Debug, + cxx_standard: 17, + enable_sanitizers_in_tests: ON + } + steps: + - uses: actions/checkout@v3 + - name: Build project + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ + -DENABLE_TESTING=ON \ + -DOVERRIDE_CXX_STANDARD_FOR_TESTS=${{ matrix.config.cxx_standard }} \ + -DENABLE_SANITIZERS_IN_TESTS=${{ matrix.config.enable_sanitizers_in_tests }} + cmake --build build -j + - name: Run tests + run: | + ctest --test-dir build/ --verbose diff --git a/.github/workflows/ci_windows_msvc.yml b/.github/workflows/ci_windows_msvc.yml index 4cfcf8cd..023da0de 100644 --- a/.github/workflows/ci_windows_msvc.yml +++ b/.github/workflows/ci_windows_msvc.yml @@ -67,4 +67,4 @@ jobs: cmake --build build --config ${{ matrix.config.build_type }} -j - name: Run tests run: | - build/tests/Debug/FakeIt_tests.exe + ctest --test-dir build/ --verbose -C ${{ matrix.config.build_type }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f6767ebe..7c7cdd80 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: cmake --build build -j - name: Run tests run: | - build/tests/FakeIt_tests + ctest --test-dir build/ --verbose - name: Generate report run: | cd build/tests/CMakeFiles/FakeIt_tests.dir diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 4e27f227..00000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -name: CI OSX/AppleClang - -on: [push, pull_request] - -permissions: - contents: read - -jobs: - build: - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - build_type: [Debug] - cxx_std: [17, 20, 23] - - steps: - - uses: actions/checkout@v3 - - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build - - - name: Configure - working-directory: ${{runner.workspace}}/build - run: | - cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -DENABLE_TESTING=ON \ - -DCMAKE_CXX_EXTENSIONS=OFF \ - -DOVERRIDE_CXX_STANDARD_FOR_TESTS=${{matrix.cxx_std}} \ - -DENABLE_SANITIZERS_IN_TESTS=ON \ - $GITHUB_WORKSPACE - - - name: Build - working-directory: ${{runner.workspace}}/build - run: | - threads=`sysctl -n hw.logicalcpu` - cmake --build . --config ${{matrix.build_type}} --parallel $threads - - - name: Test - working-directory: ${{runner.workspace}}/build - run: ctest -C ${{matrix.build_type}} - env: - CTEST_OUTPUT_ON_FAILURE: True diff --git a/.gitignore b/.gitignore index 6709d471..746f57a2 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,8 @@ bii/ *.*~ *.nupkg +# Build +build/ + +# Testing +Testing/