Add extension to allow bazelmod style handling of dependencies #428
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
env: | |
BAZEL_STARTUP_FLAGS: --bazelrc=${{ github.workspace }}/.github/github.bazelrc | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-14 | |
- os: ubuntu-20.04 | |
- os: windows-2019 | |
steps: | |
# Checkout the code | |
- uses: actions/checkout@v2 | |
# Caches and restores the Bazel outputs. | |
- name: Retain Bazel cache (linux) | |
uses: actions/cache@v2 | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
~/.cache/bazel | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
if: startswith(runner.os, 'Linux') | |
- name: Retain Bazel cache (MacOS) | |
uses: actions/cache@v2 | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
/private/var/tmp/_bazel_runner | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
if: startswith(runner.os, 'MacOS') | |
- name: Retain Bazel cache (Windows) | |
uses: actions/cache@v2 | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
C:/bzl | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
if: startswith(runner.os, 'Windows') | |
- name: Setup Bazelrc (Windows) | |
run: | | |
echo "startup --output_user_root=C:/bzl" > ./user.bazelrc | |
if: startswith(runner.os, 'Windows') | |
- name: Setup Bazelrc | |
run: | | |
echo "common --keep_going" >> ./user.bazelrc | |
# Build and Test the code | |
- name: Test (Unix) | |
run: bazel ${BAZEL_STARTUP_FLAGS[@]} test //... | |
if: startswith(runner.os, 'Windows') != true | |
- name: Test (Windows) | |
run: bazel $env:BAZEL_STARTUP_FLAGS test //... | |
if: startswith(runner.os, 'Windows') | |
ci-aspects: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-14 | |
- os: ubuntu-20.04 | |
- os: windows-2019 | |
steps: | |
# Checkout the code | |
- uses: actions/checkout@v2 | |
# Caches and restores the Bazel outputs. | |
- name: Retain Bazel cache (linux) | |
uses: actions/cache@v2 | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
~/.cache/bazel | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
if: startswith(runner.os, 'Linux') | |
- name: Retain Bazel cache (MacOS) | |
uses: actions/cache@v2 | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
/private/var/tmp/_bazel_runner | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
if: startswith(runner.os, 'MacOS') | |
- name: Retain Bazel cache (Windows) | |
uses: actions/cache@v2 | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
C:/bzl | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
if: startswith(runner.os, 'Windows') | |
- name: Setup Bazelrc (Windows) | |
run: | | |
echo "startup --output_user_root=C:/bzl" > ./user.bazelrc | |
if: startswith(runner.os, 'Windows') | |
- name: Setup Bazelrc | |
run: | | |
echo "common --config=strict" >> ./user.bazelrc | |
echo "common --keep_going" >> ./user.bazelrc | |
# Build and Test the code | |
- name: Test (Unix) | |
run: bazel ${BAZEL_STARTUP_FLAGS[@]} test //... | |
if: startswith(runner.os, 'Windows') != true | |
- name: Test (Windows) | |
run: bazel $env:BAZEL_STARTUP_FLAGS test //... | |
if: startswith(runner.os, 'Windows') | |
ci-buildifier: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the code | |
- uses: actions/checkout@v2 | |
- name: Download Buildifier | |
run: | | |
wget "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-linux-amd64" -O buildifier | |
chmod +x buildifier | |
- name: Buildifier | |
run: ./buildifier -lint=warn -mode=check -warnings=all -r ${{ github.workspace }} | |
ci-gofmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: Jerome1337/[email protected] | |
with: | |
gofmt-flags: -e -d |