Commit 5a8cf4c2 authored by Robert Edmonds's avatar Robert Edmonds

build.yml: Use Ninja on Windows to speed up the build

Microsoft refuses to ship Ninja in the Windows image so a third-party
script is needed.
parent ae987b4b
...@@ -138,6 +138,9 @@ jobs: ...@@ -138,6 +138,9 @@ jobs:
with: with:
arch: amd64 arch: amd64
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Checkout protobuf-c - name: Checkout protobuf-c
uses: actions/checkout@v4 uses: actions/checkout@v4
...@@ -158,7 +161,7 @@ jobs: ...@@ -158,7 +161,7 @@ jobs:
- name: Build and install abseil - name: Build and install abseil
working-directory: "./abseil" working-directory: "./abseil"
run: | run: |
cmake -B build -G "NMake Makefiles" ` cmake -B build -G Ninja `
-DCMAKE_CXX_STANDARD=17 ` -DCMAKE_CXX_STANDARD=17 `
-DCMAKE_INSTALL_PREFIX=~/abseil-bin ` -DCMAKE_INSTALL_PREFIX=~/abseil-bin `
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ` -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} `
...@@ -166,13 +169,12 @@ jobs: ...@@ -166,13 +169,12 @@ jobs:
-DABSL_PROPAGATE_CXX_STD=ON ` -DABSL_PROPAGATE_CXX_STD=ON `
-DBUILD_SHARED_LIBS=${{ matrix.shared-lib }} ` -DBUILD_SHARED_LIBS=${{ matrix.shared-lib }} `
; ;
cmake --build "build" -j4 ninja -C build install
cmake --build "build" --target install
- name: Build and install protobuf - name: Build and install protobuf
working-directory: "./protobuf" working-directory: "./protobuf"
run: | run: |
cmake -B build -G "NMake Makefiles" ` cmake -B build -G Ninja `
-DCMAKE_CXX_STANDARD=17 ` -DCMAKE_CXX_STANDARD=17 `
-DCMAKE_INSTALL_PREFIX=~/protobuf-bin ` -DCMAKE_INSTALL_PREFIX=~/protobuf-bin `
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ` -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} `
...@@ -185,12 +187,11 @@ jobs: ...@@ -185,12 +187,11 @@ jobs:
-Dprotobuf_BUILD_SHARED_LIBS=${{ matrix.shared-lib }} ` -Dprotobuf_BUILD_SHARED_LIBS=${{ matrix.shared-lib }} `
-Dprotobuf_BUILD_TESTS=OFF ` -Dprotobuf_BUILD_TESTS=OFF `
; ;
cmake --build "build" -j4 ninja -C build install
cmake --build "build" --target install
- name: Build protobuf-c - name: Build protobuf-c
run: | run: |
cmake -S build-cmake -B build -G "NMake Makefiles" ` cmake -S build-cmake -B build -G Ninja `
-DCMAKE_INSTALL_PREFIX=~/protobuf-c-bin ` -DCMAKE_INSTALL_PREFIX=~/protobuf-c-bin `
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ` -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} `
-DCMAKE_MSVC_RUNTIME_LIBRARY=${{ env.MSVC_RUNTIME_LIBRARY }} ` -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ env.MSVC_RUNTIME_LIBRARY }} `
...@@ -199,6 +200,6 @@ jobs: ...@@ -199,6 +200,6 @@ jobs:
-DProtobuf_ROOT="~/protobuf-bin" ` -DProtobuf_ROOT="~/protobuf-bin" `
-Dabsl_ROOT="~/abseil-bin" ` -Dabsl_ROOT="~/abseil-bin" `
; ;
cmake --build "build" -j3 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