fix CI (hopefully)
Some checks failed
Validate Operations / validate-operations (push) Failing after 1h2m33s
Some checks failed
Validate Operations / validate-operations (push) Failing after 1h2m33s
This commit is contained in:
45
.github/actions/prepare-protobuf-cache/action.yml
vendored
Normal file
45
.github/actions/prepare-protobuf-cache/action.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Prepare Protobuf Cache
|
||||
description: Restore or build the cached protobuf installation.
|
||||
|
||||
inputs:
|
||||
protobuf-commit:
|
||||
description: Protobuf tag or commit to build.
|
||||
required: true
|
||||
mold-linker-flags:
|
||||
description: Linker flags used to force mold.
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Restore protobuf cache
|
||||
id: restore-protobuf-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
/usr/local/lib/libproto*
|
||||
/usr/local/include/google/protobuf
|
||||
key: protobuf-${{ runner.os }}-${{ inputs.protobuf-commit }}
|
||||
|
||||
- name: Install protobuf
|
||||
if: steps.restore-protobuf-cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
git clone --depth 1 --branch ${{ inputs.protobuf-commit }} https://github.com/protocolbuffers/protobuf
|
||||
cmake -S protobuf -B protobuf/build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${{ inputs.mold-linker-flags }}" \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS="${{ inputs.mold-linker-flags }}" \
|
||||
-DCMAKE_MODULE_LINKER_FLAGS="${{ inputs.mold-linker-flags }}"
|
||||
cmake --build protobuf/build
|
||||
sudo cmake --install protobuf/build
|
||||
rm -rf protobuf
|
||||
|
||||
- name: Save protobuf cache
|
||||
if: steps.restore-protobuf-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
/usr/local/lib/libproto*
|
||||
/usr/local/include/google/protobuf
|
||||
key: protobuf-${{ runner.os }}-${{ inputs.protobuf-commit }}
|
||||
Reference in New Issue
Block a user