|
1 | 1 | # This is a basic workflow to help you get started with Actions |
2 | 2 |
|
3 | | -name: CTest_on_push_and_pull_request |
| 3 | +name: Build and Test |
4 | 4 |
|
5 | 5 | # Controls when the workflow will run |
6 | 6 | on: |
@@ -39,51 +39,38 @@ jobs: |
39 | 39 | submodules: true |
40 | 40 |
|
41 | 41 | # Configuration for GCC |
42 | | - - name: Configuration for gcc |
| 42 | + - name: Configuration and build for gcc |
43 | 43 | 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 }} |
49 | 49 |
|
50 | 50 | # Configuration for Clang |
51 | | - - name: Configuration for clang |
| 51 | + - name: Configuration for and build clang |
52 | 52 | 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 }} |
58 | 58 |
|
59 | 59 | # Configuration for MSVC |
60 | | - - name: Configuration for msvc |
| 60 | + - name: Configuration for and build msvc |
61 | 61 | 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 }} |
83 | 67 |
|
84 | 68 | - 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 |
89 | 70 |
|
| 71 | + - name: Check Test Coverage |
| 72 | + if: ${{matrix.compiler == 'gcc' && matrix.build == 'Debug'}} |
| 73 | + uses: threeal/gcovr-action@v1.1.0 |
| 74 | + with: |
| 75 | + coveralls-send: true |
| 76 | + excludes: build/* test/* |
0 commit comments