From 1b872fe2066c3d3c8a50fb8b024d836ef5a2044b Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Tue, 9 Jul 2024 10:06:22 +0200 Subject: [PATCH] common: update files for updating repositories --- .github/workflows/pmem_ras.yml | 17 ++--------------- utils/gha-runners/run-ras-linux.yml | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pmem_ras.yml b/.github/workflows/pmem_ras.yml index 6ae2d02094a..af6e5a43274 100644 --- a/.github/workflows/pmem_ras.yml +++ b/.github/workflows/pmem_ras.yml @@ -42,20 +42,7 @@ jobs: - name: Clone the git repo uses: actions/checkout@v4 - # Variables, such as $ras_runner are hidden on the controller platform as environmental variables. - # '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. + # Variables, such as $ras_runner are set on the controller platform as environment variables. - name: Prepare and run RAS Linux tests via ansible-playbook 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. - # 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: | - if grep -E '(fatal|failed): \[ras_runner\]' playbook_output.txt; then - exit 1 - else - exit 0 - fi + run: ansible-playbook -i $ras_runner, run-ras-linux.yml -e "host=all ansible_user=$ras_user" diff --git a/utils/gha-runners/run-ras-linux.yml b/utils/gha-runners/run-ras-linux.yml index 9f9b348a84b..802fce51e07 100644 --- a/utils/gha-runners/run-ras-linux.yml +++ b/utils/gha-runners/run-ras-linux.yml @@ -68,6 +68,7 @@ # - hosts: '{{ host }}' + any_errors_fatal: true vars: bash_path: /bin/bash @@ -174,11 +175,29 @@ with_items: "{{ workspace_dirs }}" # The 'Main' branch is used for both repositories. - - name: "Clone repositories" + - name: "Ensure the working directory exists" + file: + path: "{{ working_dir_path }}" + state: directory + + - name: "Remove the PMDK repository if present" + file: + path: "{{ pmdk_install_dir_path }}" + state: absent + force: yes + + - name: "Remove the PMDK-test repository if present" + file: + path: "{{ repo.pmdk_tests.target_dir }}" + state: absent + force: yes + + - name: "Clone the PMDK & PMDK-test repositories" git: repo: "{{ item.value.url }}" dest: "{{ item.value.target_dir }}" version: "{{ item.value.branch }}" + force: yes with_dict: "{{ repo }}" - name: "Build PMDK"