summaryrefslogtreecommitdiffstats
path: root/.github/workflows/tests.yml
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-11-29 09:48:03 +0100
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-12-02 09:23:04 +0100
commitaa8df7f4d1f468e30330bc90801746b4de0e2647 (patch)
tree45de185530621691166ac6e08edaed9cae18e5fb /.github/workflows/tests.yml
parenttest: return fail if any failed (diff)
downloadmdadm-aa8df7f4d1f468e30330bc90801746b4de0e2647.tar.xz
mdadm-aa8df7f4d1f468e30330bc90801746b4de0e2647.zip
test: Fix saving artifacts
Currently, if error is returned by test command, execution of other steps is aborted. In that case, continue-on-error safe artifact but return error later and fail the job. If executions passed, there are no artifacts to safe, therefore do not safe them. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to '.github/workflows/tests.yml')
-rw-r--r--.github/workflows/tests.yml17
1 files changed, 17 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 7bfbcb3a..ce940108 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -8,6 +8,9 @@ on:
- '*.h'
- 'tests/*'
- 'test'
+ - '.github/*'
+ - '.github/workflows/*'
+ - '.github/tools/*'
jobs:
upstream_tests:
if: ${{ github.repository == 'md-raid-utilities/mdadm' }}
@@ -31,23 +34,37 @@ jobs:
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]