Skip to content

Commit

Permalink
GHA: Refactors Compile workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Feb 18, 2024
1 parent 5b9bb19 commit f66cf2a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 44 deletions.
36 changes: 6 additions & 30 deletions .github/workflows/backtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,18 @@ on:

jobs:

Compile:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: List MQL files
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname'
shell: powershell
- name: Compiles EA (MQL4)
uses: fx31337/mql-compile-action@master
with:
path: src\EA31337-Libre.mq4
verbose: true

- name: Compiles EA (MQL5)
uses: fx31337/mql-compile-action@master
with:
path: src\EA31337-Libre.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: EA
path: 'src/*.ex?'
compile:
name: Compile
uses: .github/workflows/compile.yml

Backtest:
backtest:

defaults:
run:
shell: bash

needs: Compile
name: Backtest
needs: compile
runs-on: ubuntu-latest

strategy:
Expand Down
52 changes: 40 additions & 12 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,69 @@ on:
pull_request:
paths-ignore:
- '**.md'
- '.git*'
push:
paths-ignore:
- '**.md'
- '.git*'

jobs:
Compile:
mt4:
name: Installs platform (4)
uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev
with:
artifact_name: mt4
version: 4
mt5:
name: Installs platform (5)
uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev
with:
artifact_name: mt5
version: 5

compile-ea:
defaults:
run:
shell: powershell
working-directory: src
name: Compile EA
needs: [mt4, mt5]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
name: mt${{ matrix.version }}
path: .mt${{ matrix.version }}
- name: List MQL files
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname'
shell: powershell
- name: Compiles EA (MQL4)
- name: Compiles EA
uses: fx31337/mql-compile-action@master
with:
path: src\EA31337-Libre.mq4
mt-path: .mt?
path: src\EA31337-Libre.mq${{ matrix.version }}
verbose: true

- name: Compiles EA (MQL5)
uses: fx31337/mql-compile-action@master
with:
path: src\EA31337-Libre.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: EA
name: EA-Libre.ex${{ matrix.version }}
path: 'src/*.ex?'
strategy:
matrix:
version: [4, 5]
clean-up:
name: Clean-up
needs: [compile-ea]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v4
with:
name: mt?
2 changes: 1 addition & 1 deletion src/include/classes
Submodule classes updated 610 files
2 changes: 1 addition & 1 deletion src/include/strategies

0 comments on commit f66cf2a

Please sign in to comment.