Skip to content

chore(deps): update bazel-contrib/setup-bazel action to v0.17.0 #704

chore(deps): update bazel-contrib/setup-bazel action to v0.17.0

chore(deps): update bazel-contrib/setup-bazel action to v0.17.0 #704

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
check:
name: Check source and configs (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: bazel-contrib/setup-bazel@00e306f4a9c30087696bbb67156bde227767026b # 0.17.0
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per run.
disk-cache: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}
# Share repository cache between workflows.
repository-cache: true
bazelrc: |
common --lockfile_mode=error
- name: Set up Go
id: setup-go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
check-latest: true
cache: true
- run: |
set -e
bazel run @rules_go//go -- tool fix -go=go${{ steps.setup-go.outputs.go-version }} -force true .
git diff --exit-code
bazel run //:gazelle -- fix
git diff --exit-code
bazel run @rules_go//go -- run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test -fix .
git diff --exit-code
bazel mod deps
git diff --exit-code
bazel mod tidy
git diff --exit-code
bazel run @rules_go//go -- mod tidy
git diff --exit-code
shell: bash
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: bazel-contrib/setup-bazel@00e306f4a9c30087696bbb67156bde227767026b # 0.17.0
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per run.
disk-cache: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}
# Share repository cache between workflows.
repository-cache: true
bazelrc: |
common --lockfile_mode=error
- name: Run tests (${{ runner.os }})
run: |
set -e
if [ "${{ runner.os }}" = "Windows" ]; then
bazel test //...
else
bazel coverage --combined_report=lcov //...
cp bazel-out/_coverage/_coverage_report.dat coverage.txt
fi
shell: bash
- name: Upload coverage
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
if: runner.os != 'Windows'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
fail_ci_if_error: true
verbose: true
lint:
name: Lint (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: bazel-contrib/setup-bazel@00e306f4a9c30087696bbb67156bde227767026b # 0.17.0
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per run.
disk-cache: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}
# Share repository cache between workflows.
repository-cache: true
bazelrc: |
common --lockfile_mode=error
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: Print Go version
run: go version
shell: bash
- name: Run linter
run: bazel run //:golangci-lint -- run
shell: bash
- name: Run buildifier
if: runner.os != 'Windows'
run: |
bazel run //:buildifier.check
shell: bash