Add GitHub actions workflow for testing CMake build of examples directory

I confirmed that this test would catch the problem from #12450.

PiperOrigin-RevId: 526165526
pull/12519/head
Adam Cozzette 2 years ago committed by Copybara-Service
parent 5c59290022
commit f71dc953c7
  1. 31
      .github/workflows/test_cpp.yml

@ -200,6 +200,37 @@ jobs:
ctest --verbose --parallel 20;
ccache -s'
linux-cmake-examples:
name: Linux CMake Examples
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}
submodules: recursive
- name: Setup ccache
uses: protocolbuffers/protobuf-ci/ccache@v1
with:
cache-prefix: linux-cmake-examples
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:e0eb6c69b7551d89f0dbdbe11906077a1d501229c28db39623b945e0c5d7029a
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: >-
/install.sh -DCMAKE_CXX_STANDARD=14 ${{ env.CCACHE_CMAKE_FLAGS }} \&\&
cd examples \&\&
mkdir build \&\&
cmake
${{ env.CCACHE_CMAKE_FLAGS }}
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
-DCMAKE_CXX_STANDARD=14
-S . -B build \&\&
cmake --build build
non-linux:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.

Loading…
Cancel
Save