-
Notifications
You must be signed in to change notification settings - Fork 345
automatically build library with cmake and test with ctest
#390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: build | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - master | ||
| release: | ||
| types: | ||
| - released | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
zacharyburnett marked this conversation as resolved.
Show resolved
Hide resolved
zacharyburnett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| cmake: | ||
| strategy: | ||
| matrix: | ||
| runs-on: | ||
| - ubuntu-latest | ||
| # macos-13 is an intel runner, macos-14 is apple silicon | ||
| - macos-13 | ||
| - macos-latest | ||
| fail-fast: false | ||
| runs-on: ${{ matrix.runs-on }} | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: zacharyburnett/setup-abseil-cpp@de39f445295c887839e30c864ffbbb1c0231bc83 # 1.0.5 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just wondering, what's the difference between
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was a while ago, but I think I remember that the |
||
| 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" | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - run: mkdir build | ||
| - run: cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=/usr/local/ -DBUILD_TESTS=OFF .. | ||
| working-directory: build/ | ||
| - run: sudo cmake --build . --parallel --target=install | ||
| working-directory: build/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: test | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: read-all | ||
|
|
||
| env: | ||
| GOOGLETEST_VERSION: "1.15.2" | ||
|
|
||
| jobs: | ||
| ctest: | ||
| strategy: | ||
| matrix: | ||
| runs-on: | ||
| - ubuntu-latest | ||
| # macos-13 is an intel runner, macos-14 is apple silicon | ||
| - macos-13 | ||
| - macos-latest | ||
| fail-fast: false | ||
| runs-on: ${{ matrix.runs-on }} | ||
| timeout-minutes: 30 | ||
| 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 . ${{ runner.os == 'macOS' && '--parallel' || '' }} | ||
| # building tests with `--parallel` is disabled on Linux because GitHub seems to automatically cancel the job due to resource limits(?) | ||
| working-directory: build/ | ||
| - if: always() | ||
| run: cmake --build . --parallel --target=test | ||
jmr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| working-directory: build/ | ||
Uh oh!
There was an error while loading. Please reload this page.