Version 0.1.0 #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build + Tests | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| compiler: gcc-14 | |
| cc: gcc-14 | |
| cxx: g++-14 | |
| - os: windows-latest | |
| compiler: msvc-19.44 | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| BUILD_FOLDER: build-release | |
| BUILD_TYPE: Release | |
| CONAN_PREFER_PKG_INFO: "1" | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Install gcc | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| if [[ "${{ matrix.compiler }}" == gcc-* ]]; then | |
| sudo apt-get install -y ${{ matrix.cc }} ${{ matrix.cxx }} ninja-build | |
| fi | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| - name: Set CC/CXX environment variables | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV | |
| echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install Conan & CMake | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install conan cmake | |
| - name: Cache Conan packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.conan2 | |
| key: ${{ runner.os }}-${{ matrix.compiler }}-conan-${{ hashFiles('conanfile.*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.compiler }}-conan- | |
| - name: Conan install | |
| shell: bash | |
| run: | | |
| conan profile detect --force | |
| conan install . --output-folder=${BUILD_FOLDER} -s build_type=${BUILD_TYPE} --build=missing | |
| - name: Configure with CMake (preset generated by Conan) | |
| shell: bash | |
| run: | | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| cmake --preset conan-default | |
| else | |
| cmake --preset conan-${BUILD_TYPE,,} | |
| fi | |
| - name: Build | |
| shell: bash | |
| run: cmake --build ${BUILD_FOLDER} --config ${BUILD_TYPE} | |
| - name: Run Catch2 tests | |
| shell: bash | |
| run: | | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| TEST_EXE="${BUILD_FOLDER}/Release/stronger_cpp_benchmarks.exe" | |
| else | |
| TEST_EXE="${BUILD_FOLDER}/stronger_cpp_tests" | |
| chmod +x "$TEST_EXE" || true | |
| fi | |
| "$TEST_EXE" -r junit -o test-results.xml | |
| - name: Upload JUnit test report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ runner.os }}-${{ matrix.compiler }}-tests | |
| path: test-results.xml | |
| retention-days: 14 |