From: Martin Wilck Date: Thu, 30 Oct 2025 10:31:20 +0000 (+0100) Subject: GitHub workflows: mdadm-test: new workflow for mdadm test suite X-Git-Tag: mdadm-4.5~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a083760f039bc147934f07acc8af80362864fdc;p=thirdparty%2Fmdadm.git GitHub workflows: mdadm-test: new workflow for mdadm test suite 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 --- diff --git a/.github/workflows/mdadm-test.yml b/.github/workflows/mdadm-test.yml new file mode 100644 index 00000000..516854f4 --- /dev/null +++ b/.github/workflows/mdadm-test.yml @@ -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