Skip to content

Commit 42c1d4a

Browse files
consolidate workflows
1 parent a78853b commit 42c1d4a

File tree

3 files changed

+56
-118
lines changed

3 files changed

+56
-118
lines changed

.github/workflows/bazel.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: build
1+
name: build and test
22

33
on:
44
pull_request:
55
push:
6-
branches:
7-
- master
86
release:
97
types:
108
- released
@@ -28,18 +26,71 @@ jobs:
2826
- macos-14-large
2927
- macos-14-xlarge
3028
- macos-latest-large
29+
# macos-latest-xlarge may timeout.
30+
# https://github.com/google/s2geometry/issues/409
3131
- macos-latest-xlarge
3232
fail-fast: false
3333
runs-on: ${{ matrix.runs-on }}
3434
timeout-minutes: 30
35+
env:
36+
GOOGLETEST_VERSION: "1.15.2"
3537
steps:
3638
- uses: zacharyburnett/setup-abseil-cpp@5386866b5b554e420966aa7f31a477ad92f185d2 # Not a release, but has #423 fix.
3739
with:
3840
cmake-build-args: "-DCMAKE_CXX_STANDARD=17 -DABSL_PROPAGATE_CXX_STD=ON -DABSL_ENABLE_INSTALL=ON -DBUILD_TESTING=off -DCMAKE_POSITION_INDEPENDENT_CODE=ON"
3941
abseil-version: "20250814.1"
42+
- name: retrieve googletest v${{ env.GOOGLETEST_VERSION }}
43+
run: |
44+
wget https://github.com/google/googletest/releases/download/v${{ env.GOOGLETEST_VERSION }}/googletest-${{ env.GOOGLETEST_VERSION }}.tar.gz
45+
tar -xzvf googletest-${{ env.GOOGLETEST_VERSION }}.tar.gz
46+
echo GOOGLETEST_ROOT=${{ runner.temp }}/googletest-${{ env.GOOGLETEST_VERSION }} >> $GITHUB_ENV
47+
working-directory: ${{ runner.temp }}
4048
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4149
- run: mkdir build
42-
- run: cmake -DWITH_PYTHON=yes -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=/usr/local/ -DBUILD_TESTS=OFF ..
50+
- run: >
51+
cmake
52+
-DWITH_PYTHON=yes
53+
-DCMAKE_CXX_STANDARD=17
54+
-DCMAKE_PREFIX_PATH=/usr/local/
55+
-DGOOGLETEST_ROOT=${{ env.GOOGLETEST_ROOT }}
56+
-DGOOGLETEST_VERSION=${{ env.GOOGLETEST_VERSION }}
57+
..
4358
working-directory: build/
44-
- run: sudo cmake --build . --parallel 45 --target=install
59+
- run: cmake --build . --parallel 45
4560
working-directory: build/
61+
- if: always()
62+
run: cmake --build . --parallel 45 --target=test
63+
env:
64+
CTEST_OUTPUT_ON_FAILURE: ON
65+
CTEST_PARALLEL_LEVEL: 45
66+
working-directory: build/
67+
bazel:
68+
runs-on: ubuntu-latest
69+
70+
# We would like to test on the oldest and newest supported.
71+
# https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md
72+
# https://bazel.build/release#support-matrix
73+
# It's not clear how to do that since bazelisk has some magic to pick a
74+
# bazel version.
75+
76+
steps:
77+
- name: Checkout repository
78+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
79+
80+
- name: Setup Bazel ${{ matrix.bazel }}
81+
uses: bazel-contrib/setup-bazel@43d7d5ceab59a307da44fc7585faa2a2fff4f88d # v0.16.0
82+
with:
83+
# Avoid downloading Bazel every time.
84+
bazelisk-cache: true
85+
# Store build cache per workflow.
86+
disk-cache: ${{ github.workflow }}
87+
# Share repository cache between workflows.
88+
repository-cache: true
89+
90+
- name: Build and Test
91+
run: |
92+
bazel test \
93+
--jobs=45 --keep_going \
94+
--test_verbose_timeout_warnings --test_output=errors \
95+
//...
96+
working-directory: src

.github/workflows/test.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)