45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Lint Bazel
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
buildifier:
|
|
runs-on: 'ubuntu-latest'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
check:
|
|
- name: Run buildifier format
|
|
run: ./buildifier -r -mode=check -lint=off .
|
|
- name: Run buildifier lint
|
|
run: ./buildifier -r -lint=warn .
|
|
name: ${{ matrix.check.name }}
|
|
env:
|
|
BUILDIFIER_VERSION: v8.2.1
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Cache buildifier
|
|
id: cache-buildifier
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ./buildifier
|
|
key: ${{ runner.os }}-buildifier-${{ env.BUILDIFIER_VERSION }}
|
|
|
|
- name: Download buildifier
|
|
if: steps.cache-buildifier.outputs.cache-hit != 'true'
|
|
run: |
|
|
wget https://github.com/bazelbuild/buildtools/releases/download/${BUILDIFIER_VERSION}/buildifier-linux-amd64 -O buildifier
|
|
chmod +x buildifier
|
|
|
|
- name: ${{ matrix.check.name }}
|
|
run: ${{ matrix.check.run }}
|