Skip to content

Commit 1f15a35

Browse files
committed
Migrate action from hand-made to marketplace. #5
1 parent aaeef6d commit 1f15a35

1 file changed

Lines changed: 25 additions & 39 deletions

File tree

.github/workflows/ctest.yaml

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This is a basic workflow to help you get started with Actions
22

3-
name: CTest_on_push_and_pull_request
3+
name: Build and Test
44

55
# Controls when the workflow will run
66
on:
@@ -39,51 +39,37 @@ jobs:
3939
submodules: true
4040

4141
# Configuration for GCC
42-
- name: Configuration for gcc
42+
- name: Configuration and build for gcc
4343
if: matrix.compiler == 'gcc'
44-
run: |
45-
echo Runs-on ${{matrix.os}}, Build with ${{matrix.compiler}}
46-
mkdir build
47-
cd build
48-
cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc
44+
uses: threeal/cmake-action@v2.0.0
45+
with:
46+
c-compiler: gcc
47+
cxx-compiler: g++
48+
build-args: --config ${{ matrix.build }}
4949

5050
# Configuration for Clang
51-
- name: Configuration for clang
51+
- name: Configuration for and build clang
5252
if: matrix.compiler == 'clang'
53-
run: |
54-
echo Runs-on ${{matrix.os}}, Build with ${{matrix.compiler}}
55-
mkdir build
56-
cd build
57-
cmake .. -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
53+
uses: threeal/cmake-action@v2.0.0
54+
with:
55+
c-compiler: clang
56+
cxx-compiler: clang++
57+
build-args: --config ${{ matrix.build }}
5858

5959
# Configuration for MSVC
60-
- name: Configuration for msvc
60+
- name: Configuration for and build msvc
6161
if: matrix.compiler == 'msvc'
62-
run: |
63-
echo "Runs-on ${{matrix.os}}, Build with ${{matrix.compiler}}"
64-
mkdir build
65-
cd build
66-
cmake .. -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl
67-
68-
# Build for Linux
69-
- name: Build for Linux
70-
if: matrix.os == 'ubuntu-latest'
71-
run: |
72-
echo Runs-on ${{matrix.os}}, ${{matrix.build}} build
73-
cd build
74-
cmake --build . --target all --config ${{ matrix.build }} --clean-first -j4
75-
76-
# Build for Windows
77-
- name: Build for Windows
78-
if: matrix.os == 'windows-latest'
79-
run: |
80-
echo "Runs-on ${{matrix.os}}, ${{matrix.build}} build"
81-
cd build
82-
cmake --build . --target all_build --config ${{ matrix.build }} --clean-first -j4
62+
uses: threeal/cmake-action@v2.0.0
63+
with:
64+
c-compiler: cl
65+
cxx-compiler: cl
66+
build-args: --config ${{ matrix.build }}
8367

8468
- name: Test
85-
run: |
86-
cd build
87-
ctest --rerun-failed --output-on-failure -j 4
88-
69+
uses: threeal/ctest-action@v1.1.0
8970

71+
- name: Check Test Coverage
72+
uses: threeal/gcovr-action@v1.1.0
73+
with:
74+
coveralls-send: true
75+
excludes: build/* test/*

0 commit comments

Comments
 (0)