Ci/build #18
This file contains 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: test | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
env: | |
GOOGLETEST_VERSION: "1.15.2" | |
jobs: | |
ctest: | |
strategy: | |
matrix: | |
runs-on: | |
- ubuntu-latest | |
- macos-13 | |
- macos-latest | |
fail-fast: false | |
runs-on: ${{ matrix.runs-on }} | |
env: | |
CTEST_OUTPUT_ON_FAILURE: ON | |
steps: | |
- uses: zacharyburnett/setup-abseil-cpp@de39f445295c887839e30c864ffbbb1c0231bc83 # 1.0.5 | |
with: | |
cmake-build-args: "-DCMAKE_CXX_STANDARD=17 -DABSL_PROPAGATE_CXX_STD=ON -DABSL_ENABLE_INSTALL=ON -DBUILD_TESTING=off -DCMAKE_POSITION_INDEPENDENT_CODE=ON" | |
abseil-version: "20240722.0" | |
- name: retrieve googletest v${{ env.GOOGLETEST_VERSION }} | |
run: | | |
wget https://github.com/google/googletest/releases/download/v${{ env.GOOGLETEST_VERSION }}/googletest-${{ env.GOOGLETEST_VERSION }}.tar.gz | |
tar -xzvf googletest-${{ env.GOOGLETEST_VERSION }}.tar.gz | |
echo GOOGLETEST_ROOT=${{ runner.temp }}/googletest-${{ env.GOOGLETEST_VERSION }} >> $GITHUB_ENV | |
working-directory: ${{ runner.temp }} | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- run: mkdir build | |
- run: cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=/usr/local/ -DGOOGLETEST_ROOT=${{ env.GOOGLETEST_ROOT }} -DGOOGLETEST_VERSION=${{ env.GOOGLETEST_VERSION }} .. | |
working-directory: build/ | |
- run: cmake --build . --parallel | |
working-directory: build/ | |
- if: always() | |
run: cmake --build . --parallel --target=test | |
working-directory: build/ | |
pytest: | |
strategy: | |
matrix: | |
runs-on: | |
- ubuntu-latest | |
- macos-latest | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
fail-fast: false | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- uses: zacharyburnett/setup-abseil-cpp@de39f445295c887839e30c864ffbbb1c0231bc83 # 1.0.5 | |
with: | |
cmake-build-args: "-DCMAKE_CXX_STANDARD=17 -DABSL_PROPAGATE_CXX_STD=ON -DABSL_ENABLE_INSTALL=ON -DBUILD_TESTING=off -DCMAKE_POSITION_INDEPENDENT_CODE=ON" | |
abseil-version: "20240722.0" | |
- name: retrieve googletest v${{ env.GOOGLETEST_VERSION }} | |
run: | | |
wget https://github.com/google/googletest/releases/download/v${{ env.GOOGLETEST_VERSION }}/googletest-${{ env.GOOGLETEST_VERSION }}.tar.gz | |
tar -xzvf googletest-${{ env.GOOGLETEST_VERSION }}.tar.gz | |
echo GOOGLETEST_ROOT=${{ runner.temp }}/googletest-${{ env.GOOGLETEST_VERSION }} >> $GITHUB_ENV | |
working-directory: ${{ runner.temp }} | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install . | |
env: | |
SETUPTOOLS_CMAKE_OPTIONS: "-DGOOGLETEST_ROOT=${{ runner.temp }}/googletest-${{ env.GOOGLETEST_VERSION }} -DGOOGLETEST_VERSION=${{ env.GOOGLETEST_VERSION }}" | |
- run: pip install pytest | |
- run: pytest | |