throw_helper - a unified way to throw null pointer exceptions and shu… #619
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: Continuous Integration | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| pull_request: | |
| branches: | |
| - master | |
| - develop | |
| workflow_dispatch: ~ | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: 1 | |
| NINJA_STATUS: '[%f/%t %o/sec] ' | |
| jobs: | |
| build-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tests-matrix: ${{ steps.script.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - id: script | |
| shell: pwsh | |
| run: | | |
| $json = Get-Content -Raw .github/workflows/test_matrix.json | ConvertFrom-Json | |
| Add-Content "${env:GITHUB_OUTPUT}" "matrix=$(ConvertTo-Json $json -Compress)" | |
| tests: | |
| needs: build-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| ${{ fromJSON(needs.build-matrix.outputs.tests-matrix) }} | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: friendlyanon/fetch-core-count@v1 | |
| id: cores | |
| - shell: pwsh | |
| run: New-Item build/tools -ItemType Directory -ErrorAction SilentlyContinue | |
| - shell: sudo pwsh -File {0} | |
| run: | | |
| Add-Content -Value 'Acquire::Retries "100";' -Path /etc/apt/apt.conf.d/99-custom | |
| Add-Content -Value 'Acquire::https::Timeout "240";' -Path /etc/apt/apt.conf.d/99-custom | |
| Add-Content -Value 'Acquire::http::Timeout "240";' -Path /etc/apt/apt.conf.d/99-custom | |
| Add-Content -Value 'APT::Get::Assume-Yes "true";' -Path /etc/apt/apt.conf.d/99-custom | |
| Add-Content -Value 'APT::Install-Recommends "false";' -Path /etc/apt/apt.conf.d/99-custom | |
| Add-Content -Value 'APT::Install-Suggests "false";' -Path /etc/apt/apt.conf.d/99-custom | |
| if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| - uses: ./.github/actions/fetch-cmake | |
| id: cmake | |
| with: | |
| base-directory: build/tools | |
| - uses: ./.github/actions/fetch-ninja | |
| id: ninja | |
| with: | |
| base-directory: build/tools | |
| - uses: ./.github/actions/fetch-libstdc++ | |
| id: libstdcxx | |
| with: | |
| version: ${{ matrix.libstdcxx-version }} | |
| if: ${{ matrix.stdlib == 'libstdc++' && matrix.libstdcxx-version }} | |
| - uses: ./.github/actions/fetch-clang | |
| id: clang | |
| with: | |
| version: ${{ matrix.clang-version }} | |
| base-directory: build/tools | |
| if: ${{ matrix.clang-version }} | |
| - uses: ./.github/actions/fetch-gcc | |
| id: gcc | |
| with: | |
| version: ${{ matrix.gcc-version }} | |
| if: ${{ matrix.gcc-version }} | |
| - name: Build Examples | |
| uses: ./.github/actions/cmake-build | |
| continue-on-error: ${{ matrix.os == 'macos-11' }} | |
| env: | |
| CXX: ${{ steps.clang.outputs.clangxx || steps.gcc.outputs.gplusplus }} | |
| with: | |
| cmake: ${{ steps.cmake.outputs.cmake }} | |
| ninja: ${{ steps.ninja.outputs.ninja }} | |
| jobs: ${{ steps.cores.outputs.plus_one }} | |
| source: example | |
| build: build/example | |
| args: > | |
| -DBUILD_SHARED_LIBS=${{ matrix.shared }} | |
| ${{ ( matrix.stdlib == 'libc++' && '-DCMAKE_CXX_FLAGS=-stdlib=libc++' ) || '' }} | |
| - name: Build Tests | |
| id: build_tests | |
| uses: ./.github/actions/cmake-build | |
| continue-on-error: ${{ matrix.os == 'macos-11' }} | |
| env: | |
| CXX: ${{ steps.clang.outputs.clangxx || steps.gcc.outputs.gplusplus }} | |
| with: | |
| cmake: ${{ steps.cmake.outputs.cmake }} | |
| ninja: ${{ steps.ninja.outputs.ninja }} | |
| jobs: ${{ steps.cores.outputs.plus_one }} | |
| source: test | |
| build: build/test | |
| args: > | |
| -DBUILD_SHARED_LIBS=${{ matrix.shared }} | |
| -DENABLE_THREAD_SANITIZER=${{ matrix.tsan }} | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo | |
| ${{ ( matrix.stdlib == 'libc++' && '-DCMAKE_CXX_FLAGS=-stdlib=libc++' ) || '' }} | |
| - uses: ./.github/actions/run-tests | |
| continue-on-error: ${{ startsWith(matrix.os, 'macos') }} | |
| if: steps.build_tests.outcome == 'success' | |
| with: | |
| ctest: ${{ steps.cmake.outputs.ctest }} | |
| jobs: ${{ steps.cores.outputs.plus_one }} | |
| test-dir: build/test |