]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
.github/workflows: Add checkpatch checks for commits
authorCezar Craciunoiu <cezar.craciunoiu@gmail.com>
Mon, 16 Oct 2023 14:06:17 +0000 (17:06 +0300)
committerCezar Craciunoiu <cezar.craciunoiu@gmail.com>
Thu, 2 Nov 2023 15:25:04 +0000 (17:25 +0200)
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
.github/workflows/checkpatch.yaml [new file with mode: 0644]

diff --git a/.github/workflows/checkpatch.yaml b/.github/workflows/checkpatch.yaml
new file mode 100644 (file)
index 0000000..f813b55
--- /dev/null
@@ -0,0 +1,30 @@
+name: checkpatch
+
+on:
+  push:
+    branches: [staging, stable]
+
+  pull_request:
+    types: [opened, synchronize, reopened]
+    branches: [staging]
+
+jobs:
+  checkpatch:
+    runs-on: ubuntu-latest
+    name: checkpatch
+    steps:
+      - name: Install governctl
+        run: |
+          set -xe
+          wget -q "https://github.com/unikraft/governance/releases/download/v${GOVERN_VERSION}/governance_${GOVERN_VERSION}_linux_amd64.deb"
+          sudo dpkg -i "governance_${GOVERN_VERSION}_linux_amd64.deb"
+        env:
+          GOVERN_VERSION: 0.1.0
+
+      - name: Run checkpatch through governctl
+        run: governctl pr check patch unikraft/unikraft/${PR_NUMBER}
+        env:
+          PR_NUMBER: ${{ github.event.number }}
+          GOVERN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          GOVERN_GITHUB_USER: ${{ secrets.GH_CHECKPATCH_ACTOR }}
+