Skip to content

Commit

Permalink
Merge branch 'v3.001-dev-new' into v3.002-dev-new
Browse files Browse the repository at this point in the history
* v3.001-dev-new:
  GHA: Compile: Fixes wrong path on missing inputs
  GHA: Clean-up platform artifacts after the test
  GHA: Compile: Adds support for skip_init input
  GHA: Compile: Adds support for path input
  • Loading branch information
kenorb committed Apr 24, 2024
2 parents b847600 + ac96c48 commit 5439c88
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Clean-up

# yamllint disable-line rule:truthy
on:
workflow_call:
inputs:
artifact_prefix:
default: mt
description: Artifact prefix to clean up.
required: false
type: string

jobs:

cleanup:
name: Clean-up
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ${{ inputs.artifact_prefix }}*
timeout-minutes: 5
24 changes: 16 additions & 8 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Compile

env:
ARTIFACT_PREFIX: ${{ inputs.artifact_prefix || 'mt' }}
COMPILE_PATH: ${{ inputs.path || '*' }}
SKIP_INIT: ${{ inputs.skip_init || false }}

# yamllint disable-line rule:truthy
on:
Expand All @@ -19,9 +21,19 @@ on:
description: Artifact prefix.
required: false
type: string
path:
default: '*'
description: Path to compile.
required: false
type: string
skip_cleanup:
default: false
description: Whether to skip a clean-up job.
description: Skips a clean-up job.
required: false
type: boolean
skip_init:
default: true
description: Skips initialization of the platform.
required: false
type: boolean

Expand Down Expand Up @@ -57,10 +69,10 @@ jobs:
- name: Compile
uses: fx31337/mql-compile-action@master
with:
init-platform: true
init-platform: ${{ ! env.SKIP_INIT }}
mt-path: .mt${{ matrix.version }}
path-ignore: .mt${{ matrix.version }}
path: '**/*.mq${{ matrix.version }}'
path: '${{ env.COMPILE_PATH }}/**/*.mq${{ matrix.version }}'
verbose: true
- name: Print compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
Expand All @@ -79,8 +91,4 @@ jobs:
if: inputs.skip_cleanup != true
name: Clean-up
needs: [compile]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.ARTIFACT_PREFIX }}*
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test-account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Account
skip_cleanup: true

Account-Tests-MQL4:
Expand All @@ -43,3 +44,8 @@ jobs:
with:
Script: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test-buffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Buffer
skip_cleanup: true

Buffer-Tests-MQL4:
Expand All @@ -43,3 +44,8 @@ jobs:
with:
Script: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test-indicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Indicator
skip_cleanup: true

Indicator-Tests-MQL4:
Expand Down Expand Up @@ -49,3 +50,8 @@ jobs:
BtYears: 2020
TestExpert: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test-indicators-special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Indicators/Special
skip_cleanup: true

Indicators-Tests-MQL4:
Expand All @@ -47,3 +48,8 @@ jobs:
BtYears: 2020
TestExpert: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test-indicators-tick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Indicators/Tick
skip_cleanup: true

Indicators-Tests-MQL4:
Expand All @@ -47,3 +48,8 @@ jobs:
BtYears: 2020
TestExpert: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test-indicators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Indicators
skip_cleanup: true

Indicators-Tests-MQL4:
Expand Down Expand Up @@ -112,3 +113,8 @@ jobs:
BtYears: 2020
TestExpert: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test-tick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Tick
skip_cleanup: true

Tick-Tests-MQL4:
Expand All @@ -41,3 +42,8 @@ jobs:
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test-trade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Trade
skip_cleanup: true

Trade-Tests-MQL4:
Expand All @@ -43,3 +44,8 @@ jobs:
with:
Script: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
artifact_prefix: mt
skip_cleanup: true
skip_init: false

Experts-MQL4:
defaults:
Expand Down Expand Up @@ -162,3 +163,8 @@ jobs:
with:
Script: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml

0 comments on commit 5439c88

Please sign in to comment.