Skip to content

GHA: Compile: Improves Compile workflow #181

GHA: Compile: Improves Compile workflow

GHA: Compile: Improves Compile workflow #181

Workflow file for this run

---
name: Compile
# Setting an environment variable with the value of a configuration variable.
env:
ARTIFACT_PREFIX: ${{ inputs.artifact_prefix || 'mt' }}
INDI_OTHER_WORKDIR: ${{ vars.INDI_OTHER_WORKDIR || 'indicators-other' }}
REPOSITORY: EA31337/EA31337-indicators-common
SKIP_CLEANUP: ${{ inputs.skip_cleanup || false }}
# yamllint disable-line rule:truthy
on:
pull_request:
branches:
- 'master'
- '*dev*'
paths-ignore:
- '*.md'
- '.git*'
push:
branches:
- 'master'
- '*dev*'
paths-ignore:
- '*.md'
- '.git*'
workflow_call:
inputs:
artifact_prefix:
default: mt
description: Artifact prefix.
required: false
type: string
skip_cleanup:
default: false
description: Whether to skip a clean-up job.
required: false
type: boolean
jobs:
mt4:
name: Installs platform (4)
uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev
with:
artifact_name: ${{ inputs.artifact_prefix || 'mt' }}4
artifact_overwrite: true
skip_cleanup: true
version: 4
mt5:
name: Installs platform (5)
uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev
with:
artifact_name: ${{ inputs.artifact_prefix || 'mt' }}5
artifact_overwrite: true
skip_cleanup: true
version: 5
compile-mq4:
defaults:
run:
shell: powershell
name: Compile MQL4
needs: [mt4]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.INDI_OTHER_WORKDIR }}
ref: ${{ github.head_ref || github.ref_name }}
repository: EA31337/EA31337-indicators-other
- uses: actions/checkout@v4
with:
path: Include/EA31337-classes
ref: v3.000.1
repository: EA31337/EA31337-classes
- uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
- name: Compile MQL4
uses: fx31337/mql-compile-action@master
with:
include: .
init-platform: true
mt-path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
path: ${{ env.INDI_OTHER_WORKDIR }}/**/*.mq4
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
- run: Get-Location
- name: Upload indicator artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: indicators-other-ex4
path: ${{ env.INDI_OTHER_WORKDIR }}/**/*.ex[45]
timeout-minutes: 20
compile-mq5:
defaults:
run:
shell: powershell
name: Compile MQL5
needs: [mt5]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.INDI_OTHER_WORKDIR }}
ref: ${{ github.head_ref || github.ref_name }}
repository: EA31337/EA31337-indicators-other
- uses: actions/checkout@v4
with:
path: Include/EA31337-classes
ref: v3.000.1
repository: EA31337/EA31337-classes
- uses: actions/download-artifact@v4
with:
name: mt5
path: .platform
- name: Compile MQL5
uses: fx31337/mql-compile-action@master
with:
include: .
init-platform: true
mt-path: .platform
path: ${{ env.INDI_OTHER_WORKDIR }}/**/*.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
- run: Get-Location
- name: Upload indicator artifacts
uses: actions/upload-artifact@v4
with:
name: indicators-other-ex5
path: ${{ env.INDI_OTHER_WORKDIR }}/**/*.ex[45]
cleanup:
if: inputs.skip_cleanup != true
name: Clean-up
needs: [compile-mq4, compile-mq5]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.ARTIFACT_PREFIX }}*