From 1e91b6ffb77c4ab02f8e26d2c1bbf23456ebb24d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 19:58:33 +0000 Subject: [PATCH] GHA: Improves platform workflow, adds artifact input --- .github/workflows/platform.yml | 53 +++++++++++++--------------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index eff6eb9..7ff7b59 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -1,6 +1,9 @@ --- name: Platform +env: + DEFAULT_VERSION: 5 + # yamllint disable-line rule:truthy on: pull_request: @@ -14,43 +17,27 @@ on: - '.github/workflows/platform.yml' workflow_call: inputs: + artifact: + default: platform + description: Artifact name + required: false + type: string + version: + default: "${{ env.DEFAULT_VERSION }}" + description: Platform version + type: number workdir: default: "${{ github.workspace }}" - description: 'Working directory' + description: Working directory required: false type: string jobs: - Install-MT4-Linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Installs platform - uses: dawidd6/action-ansible-playbook@v2 - with: - configuration: | - [defaults] - nocows = false - stdout_callback = yaml - directory: ${{ inputs.workdir }} - options: | - --connection local - --inventory localhost, - --verbose - playbook: molecule/mt4/converge.yml - requirements: meta/galaxy-requirements.yml - - uses: actions/upload-artifact@v4 - with: - name: platform4 - path: | - ~/.wine/drive_c/Program Files*/**/*MT* - ~/.wine/drive_c/Program Files*/**/*Meta* - timeout-minutes: 20 - Install-MT5-Linux: + Platform-Linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Installs platform + - name: Runs playbook uses: dawidd6/action-ansible-playbook@v2 with: configuration: | @@ -62,19 +49,19 @@ jobs: --connection local --inventory localhost, --verbose - playbook: molecule/mt5/converge.yml + playbook: molecule/mt${{ inputs.version }}/converge.yml requirements: meta/galaxy-requirements.yml - uses: actions/upload-artifact@v4 with: - name: platform5 + name: ${{ inputs.artifact }} path: | ~/.wine/drive_c/Program Files*/**/*MT* ~/.wine/drive_c/Program Files*/**/*Meta* timeout-minutes: 20 - Cleanup-MT-Linux: + Cleanup: + if: ${{ github.event_name != 'workflow_call' }} needs: - - Install-MT4-Linux - - Install-MT5-Linux + - Platform-Linux runs-on: ubuntu-latest steps: - uses: geekyeggo/delete-artifact@v4