diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-12-12 17:22:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-12-12 17:22:10 +0000 |
commit | 55526d6577f82349bf6bb59816680d7483b61dff (patch) | |
tree | 456f8e2360e6bbd83e4f9a571f97cda281e4d9d9 /.github | |
parent | Releasing debian version 4.3+20241108-1. (diff) | |
download | mdadm-55526d6577f82349bf6bb59816680d7483b61dff.tar.xz mdadm-55526d6577f82349bf6bb59816680d7483b61dff.zip |
Merging upstream version 4.3+20241202.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github')
-rwxr-xr-x | .github/tools/run_mdadm_tests.sh | 18 | ||||
-rw-r--r-- | .github/workflows/tests.yml | 77 |
2 files changed, 95 insertions, 0 deletions
diff --git a/.github/tools/run_mdadm_tests.sh b/.github/tools/run_mdadm_tests.sh new file mode 100755 index 0000000..456874b --- /dev/null +++ b/.github/tools/run_mdadm_tests.sh @@ -0,0 +1,18 @@ +#!/usr/bin/bash + +sudo make clean +sudo make -j$(nproc) +sudo make install +sudo mdadm -Ss +sudo ./test setup + +# Uncomment and adjust this to minimalize testing time for CI or test improvements. +# --tests=test1,test2,... Comma separated list of tests to run + +#sudo ./test --tests=00createnames + +sudo ./test --skip-broken --no-error --disable-integrity --disable-multipath --disable-linear --keep-going + +ret=$? +sudo ./test cleanup +exit $ret diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ce94010 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,77 @@ +name: tests +on: + schedule: + - cron: "0 0 * * *" + pull_request: + paths: + - '*.c' + - '*.h' + - 'tests/*' + - 'test' + - '.github/*' + - '.github/workflows/*' + - '.github/tools/*' +jobs: + upstream_tests: + if: ${{ github.repository == 'md-raid-utilities/mdadm' }} + runs-on: self-hosted + timeout-minutes: 150 + name: upstream tests + steps: + - uses: actions/checkout@v4 + if: ${{ github.event_name == 'pull_request' }} + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - uses: actions/checkout@v4 + if: ${{ github.event_name == 'schedule' }} + with: + ref: main + fetch-depth: 0 + - name: 'Prepare machine' + run: | + cd .. + vagrant halt + vagrant status + vagrant up + + - name: 'Run tests' + id: testing + continue-on-error: true + run: | + cd .. + vagrant ssh -c "cd /home/vagrant/host/mdadm && .github/tools/run_mdadm_tests.sh" + + - name: 'Copy logs to host machine' + if: ${{ steps.testing.outcome == 'failure' }} + run: | + cd .. + vagrant ssh -c "sudo mkdir -p /home/vagrant/host/logs && sudo mv /var/tmp/*.log /home/vagrant/host/logs" + + - name: "Save artifacts" + if: ${{ steps.testing.outcome == 'failure' }} + uses: actions/upload-artifact@v4 + with: + name: "Logs from failed tests" + path: /home/ci/actions-runner/_work/mdadm/logs/*.log + + - name: "Clean logs" + if: ${{ steps.testing.outcome == 'failure' }} + run: | + cd .. + sudo rm /home/ci/actions-runner/_work/mdadm/logs/*.log + + - name: "Set failed" + if: ${{ steps.testing.outcome == 'failure' }} + run: exit 1 + + cleanup: + runs-on: self-hosted + needs: [upstream_tests] + steps: + - name: Restore clean VM + run: | + cd .. + vagrant up + vagrant ssh -c "sudo mdadm -Ss" + vagrant halt |