Skip to content

Commit

Permalink
GHA: Improves platform workflow, adds artifact input
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Feb 11, 2024
1 parent 66a1265 commit 1e91b6f
Showing 1 changed file with 20 additions and 33 deletions.
53 changes: 20 additions & 33 deletions .github/workflows/platform.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Platform

env:
DEFAULT_VERSION: 5

# yamllint disable-line rule:truthy
on:
pull_request:
Expand All @@ -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: |
Expand All @@ -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
Expand Down

0 comments on commit 1e91b6f

Please sign in to comment.