Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: update files for updating repositories #6101

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions .github/workflows/pmem_ras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
21 changes: 20 additions & 1 deletion utils/gha-runners/run-ras-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
#

- hosts: '{{ host }}'
any_errors_fatal: true

vars:
bash_path: /bin/bash
Expand Down Expand Up @@ -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"
Expand Down
Loading