Skip to content

Commit

Permalink
CI: use self-hosted runner to run tests
Browse files Browse the repository at this point in the history
Use prepared VM machine in GitHub actions to run mdadm tests on it.

Signed-off-by: Kinga Stefaniuk <[email protected]>
  • Loading branch information
ktanska committed Oct 17, 2024
1 parent 0d29e12 commit 9b12f95
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/tools/run_mdadm_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/bash

sudo make clean
sudo make -j$(nproc)
sudo make install
sudo mdadm -Ss
sudo ./test setup
sudo ./test --skip-broken --no-error --disable-integrity --disable-multipath --disable-linear --keep-going
sudo ./test cleanup
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: review
on:
pull_request:
paths:
- '*.c'
- '*.h'
jobs:
upstream_tests:
if: ${{ github.repository == 'md-raid-utilities/mdadm' }}
runs-on: self-hosted
timeout-minutes: 120
name: upstream tests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 'Prepare machine'
run: |
cd ..
vagrant halt
vagrant status
vagrant up
- name: 'Run tests'
run: |
cd ..
vagrant ssh -c "cd /home/vagrant/host/mdadm && .github/tools/run_mdadm_tests.sh"
- name: "Save artifacts"
uses: actions/upload-artifact@v4
with:
name: "Logs from failed tests"
path: /var/tmp/fail*.log
cleanup:
runs-on: self-hosted
steps:
- name: Restore clean VM
run: |
cd ..
vagrant ssh -c "sudo mdadm -Ss"
vagrant halt
1 change: 1 addition & 0 deletions tests/07layouts.broken
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
always fails
3 changes: 3 additions & 0 deletions tests/07reshape5intr.broken
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
always fails

hangs
1 change: 1 addition & 0 deletions tests/14imsm-r5_3d-migrate-r4_3d.broken
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
always fails

0 comments on commit 9b12f95

Please sign in to comment.