Skip to content

Commit

Permalink
Adjust Coveralls settings.
Browse files Browse the repository at this point in the history
We reject test only.
  • Loading branch information
suikan4github committed Oct 25, 2024
1 parent db3646c commit 42d961e
Showing 1 changed file with 48 additions and 33 deletions.
81 changes: 48 additions & 33 deletions .github/workflows/ctest.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -21,46 +22,60 @@ 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 }}

# 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/*

0 comments on commit 42d961e

Please sign in to comment.