Skip to content

Have GitHub setup action write cache directories into .bazelrc. #1981

Have GitHub setup action write cache directories into .bazelrc.

Have GitHub setup action write cache directories into .bazelrc. #1981

Workflow file for this run

# Copyright 2021, 2022, 2023, 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Run Bazel tests
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
test:
name: Test
strategy:
matrix:
# We don’t use the GitHub matrix support for the Emacs toolchain to
# allow Bazel to cache intermediate results between the test runs.
bazel: [6.0.0, 6.1.2, 6.2.1, 6.3.2, 6.4.0, 6.5.0, 7.0.2, latest]
os: [ubuntu-latest, macos-latest, windows-latest]
# We can’t support older Bazel versions on Windows due to
# https://github.com/bazelbuild/bazel/issues/15073.
exclude:
- bazel: 6.0.0
os: windows-latest
- bazel: 6.1.2
os: windows-latest
- bazel: 6.2.1
os: windows-latest
runs-on: ${{matrix.os}}
steps:
- name: Check out repository
uses: actions/checkout@v4
- id: setup
name: Set up workspace
uses: ./.github/actions/set-up
- name: Run Bazel tests
# Use disk cache to speed up runs.
run: >
python build.py
--bazel=bazelisk
--msys2="${{steps.setup.outputs.msys2}}"
--profiles="${{steps.setup.outputs.profiles}}"
-- check
env:
USE_BAZEL_VERSION: ${{matrix.bazel}}
# https://github.com/bazelbuild/bazelisk/issues/88#issuecomment-625178467
BAZELISK_GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Upload profiles
uses: actions/upload-artifact@v4
with:
name: profiles for Bazel version ${{matrix.bazel}} on ${{runner.os}}
path: ${{steps.setup.outputs.profiles}}/*.json.gz
if-no-files-found: ignore