Unverified Commit 6efd7db3 authored by Robert Edmonds's avatar Robert Edmonds Committed by GitHub

Merge pull request #753 from protobuf-c/edmonds/ci/windows-dependency-updates

build.yml: Update Windows dependencies (abseil, protobuf)
parents 9ecfca9d f902dccb
...@@ -120,61 +120,79 @@ jobs: ...@@ -120,61 +120,79 @@ jobs:
cmake --build "build" --target install cmake --build "build" --target install
cmake-msvc: cmake-msvc:
runs-on: windows-latest
strategy: strategy:
matrix: matrix:
build-type: [Debug, Release] build-type: [Debug, Release]
shared-lib: [ON, OFF] shared-lib: [ON]
fail-fast: false fail-fast: false
name: "MSVC CMake (${{ matrix.build-type }}, DLL: ${{ matrix.shared-lib }})" name: "MSVC CMake (${{ matrix.build-type }}, DLL: ${{ matrix.shared-lib }})"
runs-on: windows-latest
env:
PROTOBUF_VERSION: 24.3
ABSEIL_VERSION: "20230802.0"
steps: steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1 - uses: ilammy/msvc-dev-cmd@v1
with: with:
arch: amd64 arch: amd64
- uses: actions/cache@v4
id: protobuf-cache - name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Checkout protobuf-c
uses: actions/checkout@v4
- name: Checkout abseil
uses: actions/checkout@v4
with: with:
path: ~/protobuf-bin repository: abseil/abseil-cpp
key: ${{ env.PROTOBUF_VERSION }}-${{ matrix.shared-lib }}-${{ matrix.build-type}} path: "abseil"
- uses: actions/cache@v4 ref: "20240722.0"
id: abseil-cache
- name: Checkout protobuf
uses: actions/checkout@v4
with: with:
path: ~/abseil-bin repository: protocolbuffers/protobuf
key: ${{ env.ABSEIL_VERSION }}-${{ matrix.shared-lib }}-${{ matrix.build-type}} path: "protobuf"
ref: "v29.3"
- name: Build and install abseil - name: Build and install abseil
if: steps.abseil-cache.outputs.cache-hit != 'true' working-directory: "./abseil"
run: |
cd ~
git clone --depth=1 https://github.com/abseil/abseil-cpp.git -b ${{ env.ABSEIL_VERSION }} abseil
cd ~/abseil
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX=~/abseil-bin -DBUILD_SHARED_LIBS=${{ matrix.shared-lib }} -DABSL_PROPAGATE_CXX_STD=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded${{ matrix.build-type == 'Debug' && 'Debug' || '' }}${{ matrix.shared-lib == 'ON' && 'DLL' || '' }} -DCMAKE_CXX_STANDARD=17 -S . -B "build"
cmake --build "build" -j4
cmake --build "build" --target install
- name: Build and install utf8 compression algorithm
if: matrix.shared-lib == 'OFF'
run: | run: |
cd ~ cmake -B build -G Ninja `
git clone --depth=1 https://github.com/protocolbuffers/utf8_range.git utf8_range -DCMAKE_CXX_STANDARD=17 `
cd ~/utf8_range -DCMAKE_INSTALL_PREFIX=~/abseil-bin `
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX=~/utf8_range-bin -DCMAKE_CXX_STANDARD=17 -Dutf8_range_ENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -Dabsl_ROOT=~/abseil-bin -DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY='MultiThreaded${{ matrix.build-type == 'Debug' && 'Debug' || '' }}' -S . -B "build" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} `
cmake --build "build" -j4 -DABSL_PROPAGATE_CXX_STD=ON `
cmake --build "build" --target install -DBUILD_SHARED_LIBS=${{ matrix.shared-lib }} `
;
ninja -C build install
- name: Build and install protobuf - name: Build and install protobuf
if: steps.protobuf-cache.outputs.cache-hit != 'true' working-directory: "./protobuf"
run: | run: |
cd ~ cmake -B build -G Ninja `
git clone --depth=1 https://github.com/protocolbuffers/protobuf.git -b v${{ env.PROTOBUF_VERSION }} protobuf -DCMAKE_CXX_STANDARD=17 `
cd ~/protobuf && mkdir build && cd build -DCMAKE_INSTALL_PREFIX=~/protobuf-bin `
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=~/protobuf-bin -Dprotobuf_BUILD_SHARED_LIBS=${{ matrix.shared-lib }} -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_EXAMPLES=OFF -Dprotobuf_ABSL_PROVIDER=package -Dabsl_ROOT=~/abseil-bin -DABSL_PROPAGATE_CXX_STD=ON -S . -B "build" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} `
cmake --build "build" -j4 -Dabsl_ROOT=~/abseil-bin `
cmake --build "build" --target install -Dprotobuf_ABSL_PROVIDER=package `
- name: Run cmake tests -Dprotobuf_BUILD_EXAMPLES=OFF `
-Dprotobuf_BUILD_LIBUPB=OFF `
-Dprotobuf_BUILD_SHARED_LIBS=${{ matrix.shared-lib }} `
-Dprotobuf_BUILD_TESTS=OFF `
;
ninja -C build install
- name: Build protobuf-c
run: | run: |
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=~/protobuf-c-bin -DBUILD_SHARED_LIBS=${{ matrix.shared-lib }} -DProtobuf_ROOT="~/protobuf-bin" -Dabsl_ROOT="~/abseil-bin" -Dutf8_range_ROOT="~/utf8_range-bin" -S "build-cmake" -B "build" cmake -S build-cmake -B build -G Ninja `
cmake --build "build" -j3 -DCMAKE_INSTALL_PREFIX=~/protobuf-c-bin `
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} `
-DBUILD_TESTS=ON `
-DBUILD_SHARED_LIBS=${{ matrix.shared-lib }} `
-DProtobuf_ROOT="~/protobuf-bin" `
-Dabsl_ROOT="~/abseil-bin" `
;
ninja -C build
cmake --build "build" --target test cmake --build "build" --target test
cmake --build "build" --target install cmake --build "build" --target install
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment