]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
GitHub workflows: mdadm-test: new workflow for mdadm test suite
authorMartin Wilck <mwilck@suse.com>
Thu, 30 Oct 2025 10:31:20 +0000 (11:31 +0100)
committerMariusz Tkaczyk <mtkaczyk@kernel.org>
Fri, 7 Nov 2025 12:38:44 +0000 (13:38 +0100)
Since 3822896 ("github: disable self-runners"), the mdadm test suite
is generally disabled on GitHub. Introduce a new workflow which
executes on a standard GitHub-hosted runner.

Currently some tests fail. Fixing them is out of scope for this
patch. The main reason is that the kernel of the GitHub-hosted runners is
too old.

The workflow is configured such that it will only run when
dispatched manually, or when a push or PR against a branch named
'test_on_push' or 'test_on_pr', respectively.

Signed-off-by: Martin Wilck <mwilck@suse.com>
.github/workflows/mdadm-test.yml [new file with mode: 0644]

diff --git a/.github/workflows/mdadm-test.yml b/.github/workflows/mdadm-test.yml
new file mode 100644 (file)
index 0000000..516854f
--- /dev/null
@@ -0,0 +1,71 @@
+---
+name: mdadm test
+on:
+  push:
+    branches:
+      - test_on_push
+    paths:
+      - '*.c'
+      - '*.h'
+      - 'tests/*'
+      - 'test'
+      - '.github/workflows/mdadm-test.yml'
+  pull_request:
+    branches:
+      - test_on_pr
+    paths:
+      - '*.c'
+      - '*.h'
+      - 'tests/*'
+      - 'test'
+      - '.github/workflows/mdadm-test.yml'
+  workflow_dispatch:
+jobs:
+  mdadm_tests:
+    runs-on: ubuntu-latest
+    name: Run mdadm test script
+    steps:
+      - name: Git checkout
+        uses: actions/checkout@v5
+        with:
+          fetch-depth: 0
+
+      - name: Install build dependencies
+        run: >-
+          sudo apt update &&
+          sudo apt install
+          --yes --no-upgrade --no-install-recommends --no-install-suggests
+          make gcc libudev-dev
+
+      - name: Build mdadm
+        run: make -j$(nproc) BINDIR=/usr/sbin
+
+      - name: Install mdadm
+        run: sudo make BINDIR=/usr/sbin install-bin
+
+      - name: Print mdadm version
+        run: mdadm --version
+
+      - name: Set targetdir to /mnt/tmp
+        run: sed -i '/^targetdir=/s,/var/tmp,/mnt/tmp,' test
+
+      - name: Create targetdir
+        run: sudo mkdir -p /mnt/tmp
+
+      - name: Run tests
+        id: run_tests
+        run: >-
+          sudo ./test --skip-broken --no-error
+          --disable-integrity --disable-multipath --disable-linear
+          --keep-going
+        continue-on-error: true
+
+      - name: Collect logs of failed tests
+        uses: actions/upload-artifact@v4
+        with:
+          name: "mdadm-failed-test-logs"
+          path: /mnt/tmp/*.log
+
+      - name: Fail if any test failed
+        if: steps.run_tests.outcome != 'success'
+        run: /bin/false