From 42d961e9d9223bec62eaf563d7905630430b8b5f Mon Sep 17 00:00:00 2001 From: Seiichi <26223147+suikan4github@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:25:46 +0900 Subject: [PATCH] Adjust Coveralls settings. We reject test only. --- .github/workflows/ctest.yml | 81 ++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ctest.yml b/.github/workflows/ctest.yml index 593514f..cd3c546 100644 --- a/.github/workflows/ctest.yml +++ b/.github/workflows/ctest.yml @@ -1,14 +1,15 @@ # This is a basic workflow to help you get started with Actions -name: CTest_on_push_and_pull_request +name: Build and Test # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the main branch + workflow_call: push: - branches: [ main, develop ] + branches: [ develop ] pull_request: - branches: [ main, develop ] + branches: [ develop ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -21,6 +22,13 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] build: [Release, Debug] + target: [x64, win32] + compiler: [gcc, clang, msvc] + exclude: + - {os: ubuntu-latest, compiler: msvc} + - {os: ubuntu-latest, target: win32} + - {os: windows-latest, compiler: gcc} + - {os: windows-latest, compiler: clang} # Test on specified OS runs-on: ${{ matrix.os }} @@ -28,39 +36,46 @@ jobs: # Configure - Build - Test steps: # Checks-out repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.1.7 + with: + submodules: true - # Runs commands using the runners shell - - name: Configuration - run: | - mkdir build - cd build - cmake .. -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build }} + # Configuration for GCC + - name: Configuration and build for gcc + if: matrix.compiler == 'gcc' + uses: threeal/cmake-action@v2.0.0 + with: + c-compiler: gcc + cxx-compiler: g++ + build-args: --config ${{ matrix.build }} - # Build for Linux - - name: Build for Linux - if: matrix.os == 'ubuntu-latest' - run: | - cd build - cmake --build . --target all --config ${{ matrix.build }} --clean-first -j4 + # Configuration for Clang + - name: Configuration for and build clang + if: matrix.compiler == 'clang' + uses: threeal/cmake-action@v2.0.0 + with: + c-compiler: clang + cxx-compiler: clang++ + build-args: --config ${{ matrix.build }} - # Build for Windows - - name: Build for Windows - if: matrix.os == 'windows-latest' - run: | - cd build - cmake --build . --target all_build --config ${{ matrix.build }} --clean-first -j4 + # Configuration for MSVC + - name: Configuration for and build msvc + if: matrix.compiler == 'msvc' + uses: threeal/cmake-action@v2.0.0 + with: + c-compiler: cl + cxx-compiler: cl + args : -A ${{ matrix.target }} + build-args: --config ${{ matrix.build }} - name: Test - run: | - cd build - ctest --rerun-failed --output-on-failure -j 4 - - # Created report only when Linux and Debug - - name: Gcovr ( Linux and Debug only ) - if: matrix.os == 'ubuntu-latest' && matrix.build == 'Debug' - run: | - sudo apt-get install gcovr -y > /dev/null - gcovr -r . -e build - + uses: threeal/ctest-action@v1.1.0 + - name: Check Test Coverage + if: matrix.compiler == 'gcc' && matrix.build == 'Debug' + uses: threeal/gcovr-action@v1.1.0 + with: + coveralls-send: true + excludes: | + build/* + test/*