Skip to content

Commit

Permalink
Merge pull request #24 from EA31337/dev
Browse files Browse the repository at this point in the history
CI fixes
  • Loading branch information
kenorb authored Aug 20, 2024
2 parents 93c91c4 + 86ff301 commit cef499e
Show file tree
Hide file tree
Showing 62 changed files with 1,071 additions and 1,464 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
name: Compile

# Setting an environment variable with the value of a configuration variable.
env:
ARTIFACT_PREFIX: ${{ inputs.artifact_prefix || 'mt' }}
# yamllint disable-line rule:line-length
CHECKOUT_BRANCH: ${{ inputs.checkout_branch || github.head_ref || github.ref_name }}
INDI_COMMON_WORKDIR: ${{ vars.INDI_COMMON_WORKDIR || 'indicators-common' }}
REPOSITORY: EA31337/EA31337-indicators-common
SKIP_CLEANUP: ${{ inputs.skip_cleanup || false }}
Expand Down Expand Up @@ -30,6 +33,11 @@ on:
description: Artifact prefix.
required: false
type: string
checkout_branch:
default: ${{ github.head_ref || github.ref_name }}
description: Checkout branch
required: false
type: string
skip_cleanup:
default: false
description: Whether to skip a clean-up job.
Expand All @@ -43,13 +51,16 @@ jobs:
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-platform-indicators:
Expand All @@ -73,10 +84,16 @@ jobs:
include: .
init-platform: true
mt-path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
# yamllint disable-line rule:line-length
path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}/**/MQL?/Indicators
verbose: true
- name: Copy MQL to the current location
run: Copy-Item -Path ".${{ env.ARTIFACT_PREFIX }}*\*\*\MQL?" -Destination . -Recurse -Verbose
run: >-
Copy-Item
-Path ".${{ env.ARTIFACT_PREFIX }}*\*\*\MQL?"
-Destination .
-Recurse
-Verbose
- name: List all source code files
run: '(Get-ChildItem -Recurse -Path "MQL?" -Include *.mq[45]).fullname'
- name: List compiled files
Expand All @@ -85,7 +102,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: platform-indicators-mql${{ matrix.version }}
name: ${{ env.ARTIFACT_PREFIX }}-indicators-ex${{ matrix.version }}
path: MQL?/**/*.[me][qx][45h]
- if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
Expand All @@ -95,24 +112,24 @@ jobs:
defaults:
run:
shell: powershell
name: Compile indicators
name: Compile Indicators
needs: [compile-platform-indicators]
runs-on: windows-latest
strategy:
matrix:
version: [4, 5]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: ${{ env.INDI_COMMON_WORKDIR }}
ref: ${{ github.head_ref || github.ref_name }}
ref: ${{ env.CHECKOUT_BRANCH }}
repository: EA31337/EA31337-indicators-common
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: MQL4/Include/EA31337-classes
ref: v3.000.1
repository: EA31337/EA31337-classes
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: MQL5/Include/EA31337-classes
ref: v3.000.1
Expand All @@ -124,7 +141,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: platform-indicators-mql?
pattern: ${{ env.ARTIFACT_PREFIX }}-indicators-ex?
- name: List all source code files
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname'
- name: List compiled files
Expand Down Expand Up @@ -152,9 +169,10 @@ jobs:
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
- run: Get-Location
- name: Upload indicator artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: indicators-common
# yamllint disable-line rule:line-length
name: ${{ env.ARTIFACT_PREFIX }}-indicators-common-ex${{ matrix.version }}
path: ${{ env.INDI_COMMON_WORKDIR }}/**/*.ex[45]
timeout-minutes: 30

Expand Down
153 changes: 153 additions & 0 deletions .github/workflows/run-oscillators-volume.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
name: Run (Oscillators/Volume)

env:
ARTIFACT_PREFIX: mt

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- .github/workflows/run-oscillators-volume.yml
- Oscillators/Volume/*
push:
paths:
- .github/workflows/run-oscillators-volume.yml
- Oscillators/Volume/*

jobs:
compile-indicators:
name: Compile
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
skip_cleanup: true

compile-strategy:
defaults:
run:
shell: powershell
name: Compile Strategy
needs: [compile-indicators]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
path: Strategy-Indicator
ref: v2.000-dev
repository: EA31337/Strategy-Indicator
- 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 }}4
path: .${{ env.ARTIFACT_PREFIX }}4
- uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_PREFIX }}5
path: .${{ env.ARTIFACT_PREFIX }}5
- uses: actions/download-artifact@v4
with:
pattern: |
indicators-common
platform-indicators-*
- name: Compile .mq4
uses: fx31337/mql-compile-action@master
with:
include: .
mt-path: .${{ env.ARTIFACT_PREFIX }}4
path: Strategy-Indicator
verbose: true
- name: Compile .mq5
uses: fx31337/mql-compile-action@master
with:
include: .
mt-path: .${{ env.ARTIFACT_PREFIX }}5
path: Strategy-Indicator
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: Stg_Indicator
path: 'Strategy-Indicator/*.ex[45]'
timeout-minutes: 20

run-mt5:
defaults:
run:
shell: bash
env:
OPT_TRACE: ${{ secrets.OPT_TRACE }}
name: Run (MT5)
needs: [compile-indicators, compile-strategy]
runs-on: ubuntu-latest
strategy:
matrix:
test:
- AD
# - BWMFI # @fixme
# - CHO # @fixme
# - Force # @fixme
- MFI
- OBV
- PVT
- Volumes
- VROC

steps:
- uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_PREFIX }}4
path: .${{ env.ARTIFACT_PREFIX }}4
- uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_PREFIX }}5
path: .${{ env.ARTIFACT_PREFIX }}5
- uses: actions/download-artifact@v4
with:
name: Stg_Indicator
- uses: frdrwrt/write-to-file@v1.3
with:
filepath: Stg_Indicator/Stg_Indicator.set
content: |
Indicator_Indi_Indicator_DataExportMethod=1
Indicator_Indi_Indicator_Path=Oscillators/Volume/${{ matrix.test }}
Indicator_Indi_Indicator_Type=25
mode: 0644
- name: List files
run: find . -ls
- name: Run Indicator strategy with ${{ matrix.test }} indicator
uses: fx31337/mql-tester-action@master
with:
Login: ${{ secrets.MT5_LOGIN }}
Password: ${{ secrets.MT5_PASSWORD }}
Server: MetaQuotes-Demo
TestExpert: Stg_Indicator.ex5
TestExpertParameters: ${{ github.workspace }}/Stg_Indicator/Stg_Indicator.set
TestFromDate: 2024.01.01
TestPeriod: M1
TestSymbol: EURUSD
TestToDate: 2024.01.14
UrlExpert: file://${{ github.workspace }}/Stg_Indicator.ex5
Version: 5
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: Results-Oscillators-Volume-${{ matrix.test }}
path: '**.csv'
timeout-minutes: 20

cleanup:
name: Clean-up
needs: [run-mt5]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.ARTIFACT_PREFIX }}*
Loading

0 comments on commit cef499e

Please sign in to comment.