Rev flex update (#47) #175
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: Lint and Format | |
on: [push, pull_request] | |
jobs: | |
wpiformat: | |
name: "wpiformat" | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout | |
- uses: actions/checkout@v4 | |
- name: Fetch all history and metadata | |
run: | | |
git fetch --prune --unshallow | |
git checkout -b pr | |
git branch -f master origin/master | |
# Setup dependencies | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.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/focal/ llvm-toolchain-focal-14 main' >> /etc/apt/sources.list.d/proposed-repositories.list" | |
sudo apt-get update -q | |
sudo apt-get install -y clang-format-14 | |
- name: Install wpiformat | |
run: pip3 install wpiformat | |
- name: Set up Go 1.15.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.15.x | |
id: go | |
- name: Install Buildifier | |
run: | | |
cd $(mktemp -d) | |
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected] | |
- name: Install Unused Deps | |
run: | | |
cd $(mktemp -d) | |
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected] | |
# Run formatters | |
- name: Run wpiformat | |
run: wpiformat -clang 14 | |
- name: Run buildifier | |
run: buildifier --lint=fix -r . | |
- name: Run Spotless | |
run: ./gradlew spotlessApply | |
- name: Run unused deps | |
run: unused_deps //... | |
# Check the diff | |
- name: Check Output | |
run: git --no-pager diff --exit-code HEAD | |
- name: Generate diff | |
run: git diff HEAD > wpiformat-fixes.patch | |
if: ${{ failure() }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wpiformat fixes | |
path: wpiformat-fixes.patch | |
if: ${{ failure() }} |