Skip to content

Document module extensions if possible. #1595

Document module extensions if possible.

Document module extensions if possible. #1595

Workflow file for this run

# Copyright 2021, 2022, 2023 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:
bazel-versions:
name: Bazel
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: [5.4.0, 6.0.0, 6.1.2, 6.2.1, 6.3.2, 6.4.0, 7.0.0, 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: 5.4.0
os: windows-latest
- 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@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install APT packages
run: sudo apt-get update && sudo apt-get install libxml2-utils
if: runner.os == 'Linux'
- name: Install Homebrew packages
# The Protocol Buffer rules need ‘realpath’ from the GNU coreutils.
run: brew update && brew install coreutils
if: runner.os == 'macOS'
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
update: false
release: true
# Work around https://github.com/bazelbuild/bazel/issues/15919.
location: C:\Tools\
# See nt/INSTALL.W64 for the list of required MSYS2 packages
install: >
base-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-xpm-nox
if: runner.os == 'Windows'
- name: Install Visual C++ build tools
# Install the 2019 version because Bazel doesn’t support anything newer
# in most versions; see
# https://bazel.build/install/windows#install-compilers.
run: |
choco install visualstudio2019buildtools
choco install visualstudio2019-workload-vctools
if: runner.os == 'Windows'
- name: Cache Bazel repositories
uses: actions/cache@v3
with:
path: ~/bazel-repository-cache
key: bazel-repositories-${{hashFiles('**/WORKSPACE', '**.bzl')}}
restore-keys: |
bazel-repositories-
- name: Cache Bazel results
uses: actions/cache@v3
with:
path: ~/bazel-action-cache
key: bazel-actions-${{runner.os}}-${{matrix.bazel}}-${{hashFiles('**')}}
restore-keys: |
bazel-actions-${{runner.os}}-${{matrix.bazel}}-
bazel-actions-${{runner.os}}-
- name: Run Bazel tests
# Older Bazel versions don’t support Bzlmod properly.
# Use disk cache to speed up runs.
run: >
python build.py
--bazel=bazelisk
--bzlmod=${{
(
startsWith(matrix.bazel, '5.') ||
startsWith(matrix.bazel, '6.0.') ||
startsWith(matrix.bazel, '6.1.') ||
startsWith(matrix.bazel, '6.2.')
) && 'no' || 'both'
}}
${{
(
startsWith(matrix.bazel, '5.') ||
startsWith(matrix.bazel, '6.')
) && '--ignore-lockfile' || ''
}}
--action-cache=~/bazel-action-cache
--repository-cache=~/bazel-repository-cache
-- check
env:
USE_BAZEL_VERSION: ${{matrix.bazel}}
BAZEL_VC: >-
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC
# https://github.com/bazelbuild/bazelisk/issues/88#issuecomment-625178467
BAZELISK_GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}