mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 00:33:30 +00:00
33326dd5f5
Let's see if we can get the style issues flagged inline. Sponsored by: Netflix
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
name: Style Checker
|
|
|
|
# Runs my simple style(9) checker on any pushes or pull requests. It could be
|
|
# optimized by fetching the pull request head branch back to main revisions and
|
|
# running on that. That would reduce the run time from 3-4 minutes down to 30-40
|
|
# seconds. Getting the right series of clone + fetches to get that iteratively
|
|
# is proving elusive, so optimizations welcome.
|
|
|
|
on:
|
|
pull_request: # maybe pull_request_target
|
|
branches: [ main ]
|
|
types: [ opened, reopened, edited, synchronize ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
name: Style Checker
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Install packages
|
|
run: |
|
|
sudo apt-get update --quiet || true
|
|
sudo apt-get -yq --no-install-suggests --no-install-recommends install perl
|
|
- name: Run checker
|
|
run: |
|
|
sha=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
|
|
tools/build/checkstyle9.pl --github ${sha}..${{ github.event.pull_request.head.sha }}
|