Skip to content

Bringup

Bringup #8

Workflow file for this run

name: Lint and Format
on: [pull_request, push]
jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
wpiformat:
name: "wpiformat"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fetch main
run: |
git fetch origin main
git branch -f main origin/main
if: github.ref != 'refs/heads/main'
- uses: actions/setup-python@v4
with: { python-version: '3.10.8' }
- name: Install clang-format
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo sh -c "echo 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main' >> /etc/apt/sources.list.d/proposed-repositories.list"
sudo apt-get update -q
sudo apt-get install -y clang-format-14
- run: bazel run @rules_wpiformat//wpiformat -- -f ..
working-directory: tests
if: github.ref != 'refs/heads/main'
- name: Check Output
run: git --no-pager diff --exit-code HEAD
buildifier:
name: "buildifier"
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20.x
uses: actions/setup-go@v4
with:
go-version: 1.20.x
id: go
- uses: actions/checkout@v3
- name: Install Buildifier
run: |
cd $(mktemp -d)
GO111MODULE=on go install github.com/bazelbuild/buildtools/buildifier@latest
- name: Run buildifier
run: buildifier -warnings all --lint=fix -r .
- name: Check Output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > buildifier-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v2
with:
name: buildifier fixes
path: buildifier-fixes.patch
if: ${{ failure() }}