Skip to content

v0.0.9

v0.0.9 #60

# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
name: CMake on Ubuntu
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Dependencies
run: ./dependencies.sh ${{ matrix.compiler }}
- name: Setup compiler
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
elif [ "${{ matrix.compiler }}" = "clang" ]; then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
fi
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build-${{ matrix.compiler }}-${{ matrix.build_type }} -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build-${{ matrix.compiler }}-${{ matrix.build_type }} --config ${{ matrix.build_type }}
- name: Test
working-directory: ${{github.workspace}}/build-${{ matrix.compiler }}-${{ matrix.build_type }}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ matrix.build_type }} --output-on-failure --output-junit test_report.xml
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: (!cancelled()) # Ensures this runs even if tests fail
with:
files: "build-${{ matrix.compiler }}-${{ matrix.build_type }}/test_report.xml"
- name: Capture test logging
#if: failure()
uses: actions/upload-artifact@v4
with:
name: testing-with-${{ matrix.compiler }}-${{ matrix.build_type }}.log
path: ${{github.workspace}}/build-${{ matrix.compiler }}-${{ matrix.build_type }}/Testing/Temporary/LastTest.log