From bcba6ac95094b1980707c6f6ca6e803bb16acfe5 Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:29:38 +0100 Subject: [PATCH 1/5] fix(.github/workflows): update all the workflows for reference: https://github.com/sap-linuxlab/community.sap_install/discussions/421 --- .github/workflows/ansible-lint-sap_general_preconfigure.yml | 4 ++-- .github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml | 4 ++-- .github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml | 4 ++-- .github/workflows/ansible-lint-sap_hana_install.yml | 4 ++-- .github/workflows/ansible-lint-sap_hana_preconfigure.yml | 4 ++-- .../ansible-lint-sap_hypervisor_node_preconfigure.yml | 4 ++-- .github/workflows/ansible-lint-sap_netweaver_preconfigure.yml | 4 ++-- .github/workflows/ansible-lint-sap_storage_setup.yml | 4 ++-- .github/workflows/ansible-lint-sap_swpm.yml | 4 ++-- .github/workflows/ansible-lint-sap_vm_preconfigure.yml | 4 ++-- .github/workflows/ansible-lint.yml | 4 ++-- .github/workflows/ansible-test-sanity.yml | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ansible-lint-sap_general_preconfigure.yml b/.github/workflows/ansible-lint-sap_general_preconfigure.yml index 6355423d1..3e8b1f79a 100644 --- a/.github/workflows/ansible-lint-sap_general_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_general_preconfigure.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml b/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml index d6e20713f..fdfc48474 100644 --- a/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml +++ b/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml b/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml index b1f0bc420..e820730e7 100644 --- a/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml +++ b/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_hana_install.yml b/.github/workflows/ansible-lint-sap_hana_install.yml index 2196b8c5e..3c9e6abf7 100644 --- a/.github/workflows/ansible-lint-sap_hana_install.yml +++ b/.github/workflows/ansible-lint-sap_hana_install.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_hana_preconfigure.yml b/.github/workflows/ansible-lint-sap_hana_preconfigure.yml index 3fcba086f..1895ab8ce 100644 --- a/.github/workflows/ansible-lint-sap_hana_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_hana_preconfigure.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml b/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml index 9ed7999e8..3e151ed14 100644 --- a/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml b/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml index 387a2a690..0a4f36ab2 100644 --- a/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_storage_setup.yml b/.github/workflows/ansible-lint-sap_storage_setup.yml index fa5d7ac92..1d6272514 100644 --- a/.github/workflows/ansible-lint-sap_storage_setup.yml +++ b/.github/workflows/ansible-lint-sap_storage_setup.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_swpm.yml b/.github/workflows/ansible-lint-sap_swpm.yml index 2d1587cbe..7bbbbcd54 100644 --- a/.github/workflows/ansible-lint-sap_swpm.yml +++ b/.github/workflows/ansible-lint-sap_swpm.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/ansible-lint-sap_vm_preconfigure.yml b/.github/workflows/ansible-lint-sap_vm_preconfigure.yml index 05d84672a..b25ed2e3c 100644 --- a/.github/workflows/ansible-lint-sap_vm_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_vm_preconfigure.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.12' diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index b97f0a635..d43bc8a1f 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -16,10 +16,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.12' diff --git a/.github/workflows/ansible-test-sanity.yml b/.github/workflows/ansible-test-sanity.yml index b3ce12573..b6a0521fd 100644 --- a/.github/workflows/ansible-test-sanity.yml +++ b/.github/workflows/ansible-test-sanity.yml @@ -16,10 +16,10 @@ jobs: steps: - name: Check out the code - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Set up Python 3 - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: python-version: '3.9' From 1da2d77f7bfa1accc3fc7bbe5b1678ada172094d Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:10:41 +0100 Subject: [PATCH 2/5] fix(.github/workflows): python versions --- .github/workflows/ansible-lint-sap_general_preconfigure.yml | 2 +- .github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml | 2 +- .github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml | 2 +- .github/workflows/ansible-lint-sap_hana_install.yml | 2 +- .github/workflows/ansible-lint-sap_hana_preconfigure.yml | 2 +- .../workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml | 2 +- .github/workflows/ansible-lint-sap_install_media_detect.yml | 2 +- .github/workflows/ansible-lint-sap_maintain_etc_hosts.yml | 2 +- .github/workflows/ansible-lint-sap_netweaver_preconfigure.yml | 2 +- .github/workflows/ansible-lint-sap_storage_setup.yml | 2 +- .github/workflows/ansible-lint-sap_swpm.yml | 2 +- .github/workflows/ansible-test-sanity.yml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ansible-lint-sap_general_preconfigure.yml b/.github/workflows/ansible-lint-sap_general_preconfigure.yml index 3e8b1f79a..510975f64 100644 --- a/.github/workflows/ansible-lint-sap_general_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_general_preconfigure.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml b/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml index fdfc48474..491890f27 100644 --- a/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml +++ b/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml b/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml index e820730e7..7929f5cba 100644 --- a/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml +++ b/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_hana_install.yml b/.github/workflows/ansible-lint-sap_hana_install.yml index 3c9e6abf7..ca412b753 100644 --- a/.github/workflows/ansible-lint-sap_hana_install.yml +++ b/.github/workflows/ansible-lint-sap_hana_install.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_hana_preconfigure.yml b/.github/workflows/ansible-lint-sap_hana_preconfigure.yml index 1895ab8ce..d672a5490 100644 --- a/.github/workflows/ansible-lint-sap_hana_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_hana_preconfigure.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml b/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml index 3e151ed14..92269e91d 100644 --- a/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_install_media_detect.yml b/.github/workflows/ansible-lint-sap_install_media_detect.yml index e8cb49a8a..058bd1de2 100644 --- a/.github/workflows/ansible-lint-sap_install_media_detect.yml +++ b/.github/workflows/ansible-lint-sap_install_media_detect.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@main with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_maintain_etc_hosts.yml b/.github/workflows/ansible-lint-sap_maintain_etc_hosts.yml index d0c3271ec..891a3a59e 100644 --- a/.github/workflows/ansible-lint-sap_maintain_etc_hosts.yml +++ b/.github/workflows/ansible-lint-sap_maintain_etc_hosts.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@main with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml b/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml index 0a4f36ab2..88f26db26 100644 --- a/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_storage_setup.yml b/.github/workflows/ansible-lint-sap_storage_setup.yml index 1d6272514..0345c6dcf 100644 --- a/.github/workflows/ansible-lint-sap_storage_setup.yml +++ b/.github/workflows/ansible-lint-sap_storage_setup.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-lint-sap_swpm.yml b/.github/workflows/ansible-lint-sap_swpm.yml index 7bbbbcd54..4c7ed0e55 100644 --- a/.github/workflows/ansible-lint-sap_swpm.yml +++ b/.github/workflows/ansible-lint-sap_swpm.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | diff --git a/.github/workflows/ansible-test-sanity.yml b/.github/workflows/ansible-test-sanity.yml index b6a0521fd..90b32f207 100644 --- a/.github/workflows/ansible-test-sanity.yml +++ b/.github/workflows/ansible-test-sanity.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Python 3 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install test dependencies run: | From 8a7a52aa2ce59c401265473d7af8e46bb0a83b92 Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:05:42 +0100 Subject: [PATCH 3/5] feat(.github/workflows/*): add a reusable_workflow --- .../ansible-lint-sap_general_preconfigure.yml | 22 ++---------- .../ansible-lint-sap_ha_install_hana_hsr.yml | 22 ++---------- .../ansible-lint-sap_ha_pacemaker_cluster.yml | 21 ++--------- .../ansible-lint-sap_hana_install.yml | 22 ++---------- .../ansible-lint-sap_hana_preconfigure.yml | 23 ++---------- ...-lint-sap_hypervisor_node_preconfigure.yml | 22 ++---------- .../ansible-lint-sap_install_media_detect.yml | 23 ++---------- .../ansible-lint-sap_maintain_etc_hosts.yml | 23 ++---------- ...nsible-lint-sap_netweaver_preconfigure.yml | 22 ++---------- .../ansible-lint-sap_reusable_workflow.yml | 36 +++++++++++++++++++ .../ansible-lint-sap_storage_setup.yml | 22 ++---------- .github/workflows/ansible-lint-sap_swpm.yml | 22 ++---------- .../ansible-lint-sap_vm_preconfigure.yml | 24 +++---------- 13 files changed, 73 insertions(+), 231 deletions(-) create mode 100644 .github/workflows/ansible-lint-sap_reusable_workflow.yml diff --git a/.github/workflows/ansible-lint-sap_general_preconfigure.yml b/.github/workflows/ansible-lint-sap_general_preconfigure.yml index 510975f64..ce57ff97e 100644 --- a/.github/workflows/ansible-lint-sap_general_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_general_preconfigure.yml @@ -20,24 +20,8 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 + role: sap_general_preconfigure - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_general_preconfigure - run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml b/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml index 491890f27..ffcd67e70 100644 --- a/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml +++ b/.github/workflows/ansible-lint-sap_ha_install_hana_hsr.yml @@ -20,24 +20,8 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 + role: sap_ha_install_hana_hsr - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_ha_install_hana_hsr - run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml b/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml index 7929f5cba..9b6b26386 100644 --- a/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml +++ b/.github/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml @@ -20,24 +20,9 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' + role: sap_ha_pacemaker_cluster - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_ha_pacemaker_cluster - run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_hana_install.yml b/.github/workflows/ansible-lint-sap_hana_install.yml index ca412b753..d883099f2 100644 --- a/.github/workflows/ansible-lint-sap_hana_install.yml +++ b/.github/workflows/ansible-lint-sap_hana_install.yml @@ -20,24 +20,8 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 + role: sap_hana_install - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_hana_install - run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_hana_preconfigure.yml b/.github/workflows/ansible-lint-sap_hana_preconfigure.yml index d672a5490..a3935b807 100644 --- a/.github/workflows/ansible-lint-sap_hana_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_hana_preconfigure.yml @@ -20,24 +20,7 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 - - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_hana_preconfigure - run: ansible-lint + role: sap_hana_preconfigure diff --git a/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml b/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml index 92269e91d..5c2639d04 100644 --- a/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml @@ -20,24 +20,8 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 + role: sap_hypervisor_node_preconfigure - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_hypervisor_node_preconfigure - run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_install_media_detect.yml b/.github/workflows/ansible-lint-sap_install_media_detect.yml index 058bd1de2..81d7304da 100644 --- a/.github/workflows/ansible-lint-sap_install_media_detect.yml +++ b/.github/workflows/ansible-lint-sap_install_media_detect.yml @@ -20,24 +20,7 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@main - - - name: Set up Python 3 - uses: actions/setup-python@main + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 - - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_install_media_detect - run: ansible-lint + role: sap_install_media_detect diff --git a/.github/workflows/ansible-lint-sap_maintain_etc_hosts.yml b/.github/workflows/ansible-lint-sap_maintain_etc_hosts.yml index 891a3a59e..feb71f1c6 100644 --- a/.github/workflows/ansible-lint-sap_maintain_etc_hosts.yml +++ b/.github/workflows/ansible-lint-sap_maintain_etc_hosts.yml @@ -20,24 +20,7 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@main - - - name: Set up Python 3 - uses: actions/setup-python@main + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 - - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_maintain_etc_hosts - run: ansible-lint + role: sap_maintain_etc_hosts diff --git a/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml b/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml index 88f26db26..7926ffde4 100644 --- a/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_netweaver_preconfigure.yml @@ -20,24 +20,8 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 + role: sap_netweaver_preconfigure - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_netweaver_preconfigure - run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_reusable_workflow.yml b/.github/workflows/ansible-lint-sap_reusable_workflow.yml new file mode 100644 index 000000000..3f6ae0f64 --- /dev/null +++ b/.github/workflows/ansible-lint-sap_reusable_workflow.yml @@ -0,0 +1,36 @@ +--- + +# Workflow for ansible-lint of a role + +name: ansible-lint reusable workflow for role + +on: + workflow_call: + inputs: + role: + required: true + type: string + +jobs: + ansible-lint: + runs-on: ubuntu-latest + + steps: + - name: Check out the code + uses: actions/checkout@v4 + + - name: Set up Python 3 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install test dependencies + run: | + pip3 install ansible==7.5.0 + pip3 install ansible-compat==3.0.2 + pip3 install ansible-core==2.14.5 + pip3 install ansible-lint==6.8.6 + + - name: Run ansible-lint + working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/${{ inputs.role }} + run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_storage_setup.yml b/.github/workflows/ansible-lint-sap_storage_setup.yml index 0345c6dcf..8c68c3b35 100644 --- a/.github/workflows/ansible-lint-sap_storage_setup.yml +++ b/.github/workflows/ansible-lint-sap_storage_setup.yml @@ -20,24 +20,8 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 + role: sap_storage_setup - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_storage_setup - run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_swpm.yml b/.github/workflows/ansible-lint-sap_swpm.yml index 4c7ed0e55..50280cf29 100644 --- a/.github/workflows/ansible-lint-sap_swpm.yml +++ b/.github/workflows/ansible-lint-sap_swpm.yml @@ -20,24 +20,8 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 + role: sap_swpm - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_swpm - run: ansible-lint diff --git a/.github/workflows/ansible-lint-sap_vm_preconfigure.yml b/.github/workflows/ansible-lint-sap_vm_preconfigure.yml index b25ed2e3c..217cf6b9f 100644 --- a/.github/workflows/ansible-lint-sap_vm_preconfigure.yml +++ b/.github/workflows/ansible-lint-sap_vm_preconfigure.yml @@ -20,24 +20,8 @@ on: jobs: ansible-lint: - runs-on: ubuntu-latest - - steps: - - name: Check out the code - uses: actions/checkout@v4 - - - name: Set up Python 3 - uses: actions/setup-python@v5 + call-ansible-lint-with-role: + uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main with: - python-version: '3.12' - - - name: Install test dependencies - run: | - pip3 install ansible==9.1.0 - pip3 install ansible-compat==4.1.10 - pip3 install ansible-core==2.16.2 - pip3 install ansible-lint==6.22.1 - - - name: Run ansible-lint - working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/sap_vm_preconfigure - run: ansible-lint + role: sap_vm_preconfigure + From 89693e8adfe77dd777349bf2152f40b4eabf0279 Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:49:33 +0100 Subject: [PATCH 4/5] feat(ansible-lint-sap_reusable_workflow): update ansible deps --- .github/workflows/ansible-lint-sap_reusable_workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ansible-lint-sap_reusable_workflow.yml b/.github/workflows/ansible-lint-sap_reusable_workflow.yml index 3f6ae0f64..03f40bc13 100644 --- a/.github/workflows/ansible-lint-sap_reusable_workflow.yml +++ b/.github/workflows/ansible-lint-sap_reusable_workflow.yml @@ -26,10 +26,10 @@ jobs: - name: Install test dependencies run: | - pip3 install ansible==7.5.0 - pip3 install ansible-compat==3.0.2 - pip3 install ansible-core==2.14.5 - pip3 install ansible-lint==6.8.6 + pip3 install ansible==9.1.0 + pip3 install ansible-compat==4.1.10 + pip3 install ansible-core==2.16.2 + pip3 install ansible-lint==6.22.1 - name: Run ansible-lint working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/${{ inputs.role }} From 7dff401c543962210559833ac426916c7b77ad8a Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:04:52 +0100 Subject: [PATCH 5/5] fix(ansible-lint-sap_reusable_workflow): bump ansible version --- .github/workflows/ansible-lint-sap_reusable_workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible-lint-sap_reusable_workflow.yml b/.github/workflows/ansible-lint-sap_reusable_workflow.yml index 03f40bc13..63e590f96 100644 --- a/.github/workflows/ansible-lint-sap_reusable_workflow.yml +++ b/.github/workflows/ansible-lint-sap_reusable_workflow.yml @@ -27,9 +27,9 @@ jobs: - name: Install test dependencies run: | pip3 install ansible==9.1.0 - pip3 install ansible-compat==4.1.10 + pip3 install ansible-compat==4.1.11 pip3 install ansible-core==2.16.2 - pip3 install ansible-lint==6.22.1 + pip3 install ansible-lint==6.22.2 - name: Run ansible-lint working-directory: /home/runner/work/community.sap_install/community.sap_install/roles/${{ inputs.role }}