Skip to content

Commit

Permalink
Simplify ci-cmake.yml via matrix.
Browse files Browse the repository at this point in the history
Also, `VCPKG_DEFAULT_TRIPLET` doesn't need to be overridden anymore.

Change-Id: I81ebb154845910ccea46f9b53d2560a4472f5ffe
Reviewed-on: https://code-review.googlesource.com/c/re2/+/62091
Reviewed-by: Paul Wankadia <[email protected]>
Reviewed-by: Alex Chernyakhovsky <[email protected]>
  • Loading branch information
junyer committed Oct 27, 2023
1 parent ba2b010 commit 4dcf4ae
Showing 1 changed file with 11 additions and 59 deletions.
70 changes: 11 additions & 59 deletions .github/workflows/ci-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ on:
push:
branches: [main]
jobs:
# GitHub Actions doesn't provide GCC 13, so we use a Docker container instead.
# (Also, the Benchmark package on Ubuntu 22.04 LTS is problematic whereas this
# Docker container is based on Debian bookworm and so it has a newer version.)
build-linux:
runs-on: ubuntu-latest
# The Benchmark package on Ubuntu 22.04 LTS is problematic whereas this
# Docker container is based on Debian bookworm and has a newer version.
container: gcc:13
strategy:
fail-fast: false
matrix:
build_shared_libs: [OFF, ON]
steps:
- uses: actions/checkout@v3
- name: Install CMake
Expand All @@ -23,86 +24,37 @@ jobs:
apt update -y
apt install -y libabsl-dev libgtest-dev libbenchmark-dev
shell: bash
- run: .github/cmake.sh
shell: bash
build-linux-shared:
runs-on: ubuntu-latest
container: gcc:13
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Install CMake
run: |
apt update -y
apt install -y cmake
shell: bash
- name: Install Abseil, GoogleTest and Benchmark
run: |
apt update -y
apt install -y libabsl-dev libgtest-dev libbenchmark-dev
shell: bash
- run: .github/cmake.sh -D BUILD_SHARED_LIBS=ON
- run: .github/cmake.sh -D BUILD_SHARED_LIBS=${{ matrix.build_shared_libs }}
shell: bash
build-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
build_shared_libs: [OFF, ON]
steps:
- uses: actions/checkout@v3
- name: Install Abseil, GoogleTest and Benchmark
run: |
brew update
brew install abseil googletest google-benchmark
shell: bash
- run: .github/cmake.sh
shell: bash
build-macos-shared:
runs-on: macos-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Install Abseil, GoogleTest and Benchmark
run: |
brew update
brew install abseil googletest google-benchmark
shell: bash
- run: .github/cmake.sh -D BUILD_SHARED_LIBS=ON
- run: .github/cmake.sh -D BUILD_SHARED_LIBS=${{ matrix.build_shared_libs }}
shell: bash
build-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_shared_libs: [OFF, ON]
steps:
- uses: actions/checkout@v3
- name: Install Abseil, GoogleTest and Benchmark
run: |
# TODO: Remove this in September 2023, which is when the default triplet for
# vcpkg libraries will change from x86-windows to the detected host triplet.
export VCPKG_DEFAULT_TRIPLET=x64-windows
vcpkg update
vcpkg install abseil gtest benchmark
shell: bash
- run: |
.github/cmake.sh \
-D CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
shell: bash
build-windows-shared:
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Install Abseil, GoogleTest and Benchmark
run: |
# TODO: Remove this in September 2023, which is when the default triplet for
# vcpkg libraries will change from x86-windows to the detected host triplet.
export VCPKG_DEFAULT_TRIPLET=x64-windows
vcpkg update
vcpkg install abseil gtest benchmark
shell: bash
- run: |
.github/cmake.sh -D BUILD_SHARED_LIBS=ON \
.github/cmake.sh -D BUILD_SHARED_LIBS=${{ matrix.build_shared_libs }} \
-D CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
shell: bash

0 comments on commit 4dcf4ae

Please sign in to comment.