Skip to content

Commit

Permalink
common: clean up PMEM RAS workflow
Browse files Browse the repository at this point in the history
- remove redundant matrix
- use `working-directory` syntax

Signed-off-by: Jan Michalski <jan.michalski@intel.com>
  • Loading branch information
janekmi committed Jun 17, 2024
1 parent 1cea527 commit 2495f4a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/pmem_ras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ jobs:
linux:
name: PMEM_RAS
if: github.repository == 'pmem/pmdk'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [[self-hosted, ras_controller]]
runs-on: [self-hosted, ras_controller]
env:
WORKDIR: utils/gha-runners

Expand All @@ -50,15 +46,14 @@ jobs:
# 'sed' command is used to filter out IP addresses from the ansible output, it will show up as the 'ras_runner' instead.
# 'tee' command is used to save the overall output to the file. This file is needed for the next step.
- name: Prepare and run RAS Linux tests via ansible-playbook
run: |
cd $WORKDIR
ansible-playbook -i $ras_runner, run-ras-linux.yml -e "host=all ansible_user=$ras_user" | sed 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/ras_runner/' | tee playbook_output.txt
working-directory: ${{ env.WORKDIR }}
run: ansible-playbook -i $ras_runner, run-ras-linux.yml -e "host=all ansible_user=$ras_user" | sed 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/ras_runner/' | tee playbook_output.txt

# This simple step will look through the output in search of specific fail strings.
# If any phrase is found in the file, the workflow will fail.
# The workflow will fail if any of the expected phrases are found in the file.
- name: Fail the workflow if the playbook finished with a failure
working-directory: ${{ env.WORKDIR }}
run: |
cd $WORKDIR
if grep -E 'fatal: \[ras_runner\]: FAILED!|failed: \[ras_runner\]' "playbook_output.txt"; then
exit 1
else
Expand Down

0 comments on commit 2495f4a

Please sign in to comment.