mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 08:12:27 -04:00
Signed-off-by: Ahmad Khalifa <ahmadkhalifa570@gmail.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1538
36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
name: Style Checker
|
|
|
|
# Runs my simple style(9) checker on pull requests.
|
|
|
|
on:
|
|
pull_request: # maybe pull_request_target
|
|
branches: [ main ]
|
|
types: [ opened, reopened, edited, synchronize ]
|
|
paths: [ '**.S', '**.c', '**.cc', '**.cpp', '**.h', '**.hh', '**.hpp' ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
name: Style Checker
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Unfortunately there doesn't seem to be a way to
|
|
# do this without an extra step.
|
|
- name: Get depth
|
|
run: |
|
|
echo "DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV
|
|
- name: checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: ${{ env.DEPTH }}
|
|
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 rev-parse HEAD~${{ github.event.pull_request.commits }})
|
|
tools/build/checkstyle9.pl --github ${sha}..${{ github.event.pull_request.head.sha }}
|