]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
CI: create review.yml file
authorKinga Stefaniuk <kinga.stefaniuk@intel.com>
Thu, 11 Apr 2024 08:37:39 +0000 (10:37 +0200)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Wed, 15 May 2024 12:12:43 +0000 (14:12 +0200)
Introduce review.yml used by GitHub actions. Add make probe, checkpatch
and hardening-check on every pull request.
Add dependabot.yml file which check for updates of actions used in this
repository. This option enables to automatically fill new PR with action
updated to the latest version.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
.checkpatch.conf [new file with mode: 0644]
.github/dependabot.yml [new file with mode: 0644]
.github/tools/install_ubuntu_packages.sh [new file with mode: 0755]
.github/workflows/review.yml [new file with mode: 0644]

diff --git a/.checkpatch.conf b/.checkpatch.conf
new file mode 100644 (file)
index 0000000..26b8114
--- /dev/null
@@ -0,0 +1,16 @@
+--no-tree
+--show-types
+--exclude .github
+--exclude clustermd_tests
+--exclude documentation
+--exclude misc
+--exclude systemd
+--exclude tests
+--exclude *.md
+--exclude *.4
+--exclude *.in
+--exclude *.8
+--exclude test
+--exclude udev-*
+--ignore FILE_PATH_CHANGES
+--ignore EMAIL_SUBJECT
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644 (file)
index 0000000..1230149
--- /dev/null
@@ -0,0 +1,6 @@
+version: 2
+updates:
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: "daily"
diff --git a/.github/tools/install_ubuntu_packages.sh b/.github/tools/install_ubuntu_packages.sh
new file mode 100755 (executable)
index 0000000..1a31ca4
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/bash
+
+VERSION_CODENAME=$(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')
+echo "Detected VERSION_CODENAME: $VERSION_CODENAME"
+
+# Add ubuntu repository
+sudo add-apt-repository -y "deb [arch=amd64] http://archive.ubuntu.com/ubuntu $VERSION_CODENAME \
+        main universe"
+# Install gcc
+sudo apt-get -y update && sudo apt-get -y install gcc-$1
+# Install dependencies
+sudo apt-get -y install make gcc libudev-dev devscripts
diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml
new file mode 100644 (file)
index 0000000..57f5d23
--- /dev/null
@@ -0,0 +1,41 @@
+name: review
+on: [pull_request]
+env:
+  cflags: -Werror
+jobs:
+  make:
+    runs-on: ubuntu-latest
+    name: Compilation test with gcc
+    strategy:
+      matrix:
+        gcc-version: [7, 8, 9, 10, 11, 12, 13]
+    steps:
+        - uses: actions/checkout@v4
+        - name: 'Add ubuntu repository and install dependencies'
+          run: .github/tools/install_ubuntu_packages.sh ${{ matrix.gcc-version }}
+        - name: 'Make with DEBUG flag'
+          run: CC=gcc-${{ matrix.gcc-version }} && V=1 make -j$(nproc) -B CXFLAGS=-DEBUG && make clean
+        - name: 'Make with DEBIAN flag'
+          run: CC=gcc-${{ matrix.gcc-version }} && V=1 make -j$(nproc) -B CXGALGS=-DEBIAN && make clean
+        - name: 'Make with USE_PTHREADS flag'
+          run: CC=gcc-${{ matrix.gcc-version }} && V=1 make -j$(nproc) -B CXFLAGS=-USE_PTHREADS && make clean
+        - name: 'Make with DNO_LIBUDEV flag'
+          run: CC=gcc-${{ matrix.gcc-version }} && V=1 make -j$(nproc) -B CXFLAGS=-DNO_LIBUDEV && make clean
+        - name: 'Make'
+          run: CC=gcc-${{ matrix.gcc-version }} && V=1 make -j$(nproc)
+        - name: hardening-check mdadm
+          run: hardening-check mdadm
+        - name: hardening-check mdmon
+          run: hardening-check mdmon
+  checkpatch:
+    runs-on: ubuntu-latest
+    name: checkpatch review
+    steps:
+    - name: 'Calculate PR commits + 1'
+      run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV
+    - uses: actions/checkout@v4
+      with:
+        ref: ${{ github.event.pull_request.head.sha }}
+        fetch-depth: ${{ env.PR_FETCH_DEPTH }}
+    - name: Run checkpatch review
+      uses: webispy/checkpatch-action@v9