Skip to content

Commit

Permalink
Try key values in matrix config.
Browse files Browse the repository at this point in the history
  • Loading branch information
ohodson committed Oct 8, 2023
1 parent c080835 commit fcb7431
Showing 1 changed file with 19 additions and 30 deletions.
49 changes: 19 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,34 @@ jobs:
test:
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-2022]
os: [
{ "name" : "Linux", image : "ubuntu-20.04" },
{ "name" : "macOS", image : "macos-latest" },
{ "name" : "Windows", image : "windows-2022" }
]
config: [
{"suffix": "", "bazel-args": "" },
{"suffix": "dbg", "bazel-args": "-c dbg" }
]
include:
- os-name: linux-asan
os: ubuntu-20.04
bazel-args: --config=asan
- os-name: linux-dbg
os: ubuntu-20.04
bazel-args: -c dbg
- os-name: macOS-dbg
os: macos-latest
bazel-args: -c dbg
- os-name: windows-dbg
os: windows-2022
bazel-args: -c dbg
# - os-name: linux
# os: ubuntu-20.04
# bazel-args: -c fastbuild
- os-name: macOS
os: macos-latest
bazel-args: -c fastbuild
- os-name: windows
os: windows-2022
bazel-args: -c fastbuild
- os: { "name": "Linux", "image": "ubuntu-20.04" }
config: {"suffix": "asan", "bazel-args": "--config=asan" }
fail-fast: false
runs-on: ${{ matrix.os }}
name: test (${{ matrix.os-name }})
runs-on: ${{ matrix.os.image }}
name: test (${{ matrix.os.name }}${{ matrix.config.suffix}})
steps:
- uses: actions/checkout@v3
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: ~/bazel-disk-cache
key: bazel-disk-cache-${{ runner.os-name }}-${{ runner.arch }}-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE') }}
key: bazel-disk-cache-${{ matrix.os.name }}${{ matrix.config.suffix}}-${{ runner.arch }}-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE') }}
# Intentionally not reusing an older cache entry using a key prefix, bazel frequently
# ends up with a larger cache at the end when starting with an available cache entry,
# resulting in a snowballing cache size and cache download/upload times.
- name: Setup Linux
if: runner.os == 'Linux'
if: runner.os.name == 'Linux'
# Install dependencies, including clang via through LLVM APT repository. Note that this
# will also install lldb and clangd alongside dependencies, which can be removed with
# `sudo apt-get remove -y lldb-14 clangd-14; sudo apt-get autoremove -y` if space is
Expand All @@ -69,15 +58,15 @@ jobs:
echo "build:linux --host_action_env=CC=/usr/lib/llvm-14/bin/clang --host_action_env=CXX=/usr/lib/llvm-14/bin/clang++" >> .bazelrc
sed -i -e "s%llvm-symbolizer%/usr/lib/llvm-14/bin/llvm-symbolizer%" .bazelrc
- name: Setup macOS
if: runner.os == 'macOS'
if: runner.os.name == 'macOS'
# We want to symbolize stacks for crashes on CI. Xcode is currently based on LLVM 15
# and the macos-12 image has llvm@15 installed:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
run: |
export LLVM_SYMBOLIZER=$(brew --prefix llvm@15)/bin/llvm-symbolizer
sed -i -e "s%llvm-symbolizer%${LLVM_SYMBOLIZER}%" .bazelrc
- name: Setup Windows
if: runner.os == 'Windows'
if: runner.os.name == 'Windows'
# Set a custom output dir and disable generating debug information on Windows. By default,
# bazel generates huge amounts of debug information on Windows which slows down the build
# and takes up an excessive amount of cache space.
Expand All @@ -90,10 +79,10 @@ jobs:
# timestamps are no longer being added here, the GitHub logs include timestamps (Use
# 'Show timestamps' on the web interface)
run: |
bazelisk build ${{ matrix.bazel-args }} --disk_cache=~/bazel-disk-cache --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev --verbose_failures //...
bazelisk build ${{ matrix.config.bazel-args }} --disk_cache=~/bazel-disk-cache --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev --verbose_failures //...
- name: Bazel tests
run: |
bazelisk test ${{ matrix.bazel-args }} --disk_cache=~/bazel-disk-cache --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev --verbose_failures --keep_going --test_output=errors //...
bazelisk test ${{ matrix.config.bazel-args }} --disk_cache=~/bazel-disk-cache --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev --verbose_failures --keep_going --test_output=errors //...
- name: Report disk usage
if: always()
shell: bash
Expand Down

0 comments on commit fcb7431

Please sign in to comment.