From 15d559eb029f911ebe44f87951025e4d46efbb30 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sat, 6 Jan 2024 08:20:17 -0700 Subject: [PATCH] Connect my checkstyle9.pl script to a action. Sponsored by: Netflix --- .github/workflows/cross-bootstrap-tools.yml | 2 +- .github/workflows/style.yml | 29 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index ddfcb467126e93..4bd653e5065462 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -2,7 +2,7 @@ name: Cross-build Kernel on: push: - branches: [ main, 'stable/13' ] + branches: [ main, 'stable/13', 'stable/14' ] pull_request: branches: [ main ] diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 00000000000000..aedd26db087099 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,29 @@ +name: Style Checker + +on: + push: + branches: [ main, 'stable/13', 'stable/14' ] + pull_request: # maybe pull_request_target + branches: [ main ] +# types: [ opened, reopened, edited ] + +permissions: + contents: read + +jobs: + build: + name: Style Checker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 100 # Limit pull requests to 100, sorry + fetch-tags: true # wish I could easliy fetch main tag only + 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: | + tools/build/checkstyle9.pl main..${{ github.event.pull_request.head.sha }}