chore(deps): update codecov/codecov-action action to v5 #1039
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: C++ Unit CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
env: | |
vcpkg_SHA: "2024.09.30" | |
jobs: | |
build-ubuntu-focal: | |
name: ubuntu-22.04 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: install ninja | |
run: sudo apt install ninja-build | |
- uses: actions/checkout@v4 | |
- name: clone-vcpkg | |
working-directory: "${{runner.temp}}" | |
run: > | |
mkdir -p vcpkg && | |
curl -sSL "https://github.com/microsoft/vcpkg/archive/${{env.vcpkg_SHA}}.tar.gz" | | |
tar -C vcpkg --strip-components=1 -zxf - | |
- name: cache-vcpkg | |
id: cache-vcpkg | |
uses: actions/cache@v4 | |
with: | |
# Preserve the vcpkg binary *and* the vcpkg binary cache in the build cache | |
path: | | |
~/.cache/vcpkg | |
~/.cache/bin | |
key: | | |
vcpkg-${{ env.vcpkg_SHA }}-build-ubuntu-focal-${{ hashFiles('vcpkg.json') }} | |
restore-keys: | | |
vcpkg-${{ env.vcpkg_SHA }}-build-ubuntu-focal- | |
- name: boostrap-vcpkg | |
run: ci/restore-vcpkg-from-cache.sh "${{runner.temp}}/vcpkg" | |
- name: configure | |
run: > | |
cmake -S . -B "${{runner.temp}}/build" -GNinja | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
-DCMAKE_TOOLCHAIN_FILE="${{runner.temp}}/vcpkg/scripts/buildsystems/vcpkg.cmake" | |
- uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: | | |
~/.cache/vcpkg | |
~/.cache/bin | |
key: vcpkg-${{ env.vcpkg_SHA }}-build-ubuntu-focal-${{ hashFiles('vcpkg.json') }} | |
- name: build | |
run: cmake --build "${{runner.temp}}/build" | |
- name: test | |
working-directory: "${{runner.temp}}/build" | |
run: ctest --output-on-failure --timeout 60 | |
# Verify the howto guides compile correctly, they need a special setup to use the | |
# current version of `functions-framework-cpp` through vcpkg. | |
build-ubuntu-focal-howto: | |
name: ubuntu-22.04 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: install ninja | |
run: sudo apt install ninja-build | |
- uses: actions/checkout@v4 | |
- name: cache-vcpkg | |
id: cache-vcpkg | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/vcpkg | |
key: | | |
vcpkg-${{ env.vcpkg_SHA }}-${{ runner.os }}-${{ github.job }}-${{ hashFiles('vcpkg.json') }} | |
restore-keys: | | |
vcpkg-${{ env.vcpkg_SHA }}-${{ runner.os }}-${{ github.job }}- | |
- name: create-overlay | |
# We want to test with the *current* version of | |
# `functions-framework-cpp`, not with the version published by vcpkg. | |
# One can do that by creating an vcpkg overlay. | |
run: > | |
mkdir -p "${{runner.temp}}/quickstart/vcpkg-overlays" && | |
cp build_scripts/vcpkg-overlays/* "${{runner.temp}}/quickstart/vcpkg-overlays" && | |
sed -i -e "s;/usr/local/share/gcf;${{github.workspace}};" \ | |
${{runner.temp}}/quickstart/vcpkg-overlays/portfile.cmake | |
- name: configure-local-development | |
env: | |
VCPKG_OVERLAY_PORTS: "${{runner.temp}}/quickstart/vcpkg-overlays" | |
run: > | |
cmake -S examples/site/howto_local_development -B "${{runner.temp}}/howto_local_development/build" -GNinja | |
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake | |
- uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: | | |
~/.cache/vcpkg | |
key: vcpkg-${{ env.vcpkg_SHA }}-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} | |
- name: build-local-development | |
env: | |
VCPKG_OVERLAY_PORTS: "${{runner.temp}}/quickstart/vcpkg-overlays" | |
run: > | |
cmake --build "${{runner.temp}}/howto_local_development/build" | |
build-msvc-2019: | |
if: ${{ false }} # TODO(#366) - disable for now | |
name: msvc-2019 | |
runs-on: windows-2022 | |
steps: | |
- name: install-ninja | |
run: choco install -y --no-progress ninja | |
- name: clone-vcpkg | |
working-directory: "${{runner.temp}}" | |
run: | | |
$ErrorActionPreference = "Stop" | |
(New-Object System.Net.WebClient).Downloadfile( | |
'https://github.com/microsoft/vcpkg/archive/${{env.vcpkg_SHA}}.zip', | |
'${{env.vcpkg_SHA}}.zip') | |
7z x '${{env.vcpkg_SHA}}.zip' -aoa -bsp0 | |
if ($LastExitCode) { Write-Host -ForegroundColor Red "error extracting vcpkg zipball: ${LastExitCode}"; Exit 1; } | |
Rename-Item 'vcpkg-${{env.vcpkg_SHA}}' 'vcpkg' | |
& vcpkg/bootstrap-vcpkg.bat | |
- name: cache-vcpkg | |
id: cache-vcpkg | |
uses: actions/cache@v4 | |
with: | |
# Preserve the vcpkg binary cache | |
path: | | |
~\AppData\Local\vcpkg\archives | |
key: | | |
vcpkg-${{ env.vcpkg_SHA }}-build-msvc-2019-2-${{ hashFiles('vcpkg.json') }} | |
restore-keys: | | |
vcpkg-${{ env.vcpkg_SHA }}-build-msvc-2019-2- | |
- uses: actions/checkout@v4 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
- name: configure | |
run: | | |
cmake -S . -B '${{runner.temp}}/build' -GNinja ` | |
'-DBUILD_TESTING=ON' ` | |
'-DFUNCTIONS_FRAMEWORK_CPP_TEST_EXAMPLES=OFF' ` | |
'-DCMAKE_TOOLCHAIN_FILE=${{runner.temp}}/vcpkg/scripts/buildsystems/vcpkg.cmake' | |
- uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: | | |
~\AppData\Local\vcpkg\archives | |
key: vcpkg-${{ env.vcpkg_SHA }}-build-msvc-2019-2-${{ hashFiles('vcpkg.json') }} | |
- name: build | |
run: cmake --build "${{runner.temp}}/build" | |
- name: test | |
working-directory: "${{runner.temp}}/build" | |
run: ctest --output-on-failure --timeout 60 | |
build-macos: | |
if: ${{ false }} # TODO(#367) - disable for now | |
name: macos-10 | |
runs-on: macos-10.15 | |
steps: | |
- name: install ninja | |
run: brew install ninja | |
- uses: actions/checkout@v4 | |
- name: clone-vcpkg | |
working-directory: "${{runner.temp}}" | |
run: > | |
mkdir -p vcpkg && | |
curl -sSL "https://github.com/microsoft/vcpkg/archive/${{env.vcpkg_SHA}}.tar.gz" | | |
tar -C vcpkg --strip-components=1 -zxf - | |
- name: cache-vcpkg | |
id: cache-vcpkg | |
uses: actions/cache@v4 | |
with: | |
# Preserve the vcpkg binary *and* the vcpkg binary cache in the build cache | |
path: | | |
~/.cache/vcpkg | |
~/.cache/bin | |
key: | | |
vcpkg-${{ env.vcpkg_SHA }}-build-macos-10-${{ hashFiles('vcpkg.json') }} | |
restore-keys: | | |
vcpkg-${{ env.vcpkg_SHA }}-build-macos-10- | |
- name: boostrap-vcpkg | |
run: ci/restore-vcpkg-from-cache.sh "${{runner.temp}}/vcpkg" | |
- name: configure | |
run: > | |
cmake -S . -B "${{runner.temp}}/build" -GNinja | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
-DCMAKE_TOOLCHAIN_FILE="${{runner.temp}}/vcpkg/scripts/buildsystems/vcpkg.cmake" | |
- uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: | | |
~/.cache/vcpkg | |
~/.cache/bin | |
key: vcpkg-${{ env.vcpkg_SHA }}-build-macos-10-${{ hashFiles('vcpkg.json') }} | |
- name: build | |
run: cmake --build "${{runner.temp}}/build" | |
- name: test | |
working-directory: "${{runner.temp}}/build" | |
run: ctest --output-on-failure --timeout 60 |