Skip to content

Commit

Permalink
GHA: Fixes Exchange CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Sep 2, 2024
1 parent 869bd26 commit 37d96da
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 33 deletions.
42 changes: 31 additions & 11 deletions .github/workflows/test-exchange-account.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
---
name: Test Exchange/Account

env:
TEST_PATH: Exchange/Account/tests

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- 'Exchange/Account/**'
- '.github/workflows/test-exchange/account.yml'
- .github/workflows/test-exchange-account.yml
- Exchange/Account/**
push:
paths:
- 'Exchange/Account/**'
- '.github/workflows/test-exchange/account.yml'
- .github/workflows/test-exchange-account.yml
- Exchange/Account/**

jobs:

Expand All @@ -22,12 +25,12 @@ jobs:
path: Exchange/Account/tests
skip_cleanup: true

Tests-MQL4:
test:
defaults:
run:
shell: bash
working-directory: Exchange/Account/tests
if: false
working-directory: ${{ env.TEST_PATH }}
name: Test
needs: compile
runs-on: ubuntu-latest
strategy:
Expand All @@ -36,15 +39,32 @@ jobs:
- Account.test
- AccountForex.test
- AccountMt.test
version: [5]
max-parallel: 4
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: files-ex4
name: files-ex${{ matrix.version }}
- name: List compiled files
run: find . -name '*.ex?' -type f -print
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
timeout-minutes: 10
Login: ${{ secrets.MT5_LOGIN }}
Password: ${{ secrets.MT5_PASSWORD }}
Server: MetaQuotes-Demo
TestDeposit: 2000
TestExpert: ${{ matrix.test }}
TestFromDate: ${{ matrix.year }}.01.01
TestPeriod: M1
TestSymbol: EURUSD
TestToDate: ${{ matrix.year }}.01.14
# yamllint disable-line rule:line-length
UrlExpert: file://${{ github.workspace }}/${{ env.TEST_PATH }}/${{ matrix.test }}.ex${{ matrix.version }}
Version: 5
- if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 20

cleanup:
name: Clean-up
Expand Down
47 changes: 36 additions & 11 deletions .github/workflows/test-exchange-symbolinfo.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
---
name: Test Exchange/SymbolInfo

env:
TEST_PATH: Exchange/SymbolInfo/tests

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- 'Exchange/SymbolInfo/**'
- '.github/workflows/test-exchange/symbolinfo.yml'
- .github/workflows/test-exchange-symbolinfo.yml
- Exchange/SymbolInfo/**
push:
paths:
- 'Exchange/SymbolInfo/**'
- '.github/workflows/test-exchange/symbolinfo.yml'
- .github/workflows/test-exchange-symbolinfo.yml
- Exchange/SymbolInfo/**

jobs:

Expand All @@ -22,24 +25,46 @@ jobs:
path: Exchange/SymbolInfo/tests
skip_cleanup: true

Tests-MQL4:
test:
defaults:
run:
shell: bash
working-directory: Exchange/SymbolInfo/tests
if: false
working-directory: ${{ env.TEST_PATH }}
name: Test
needs: compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- SymbolInfo.test
version: [5]
max-parallel: 4
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: files-ex4
name: files-ex${{ matrix.version }}
- name: List compiled files
run: find . -name '*.ex?' -type f -print
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
timeout-minutes: 10
Login: ${{ secrets.MT5_LOGIN }}
Password: ${{ secrets.MT5_PASSWORD }}
Server: MetaQuotes-Demo
TestDeposit: 2000
TestExpert: ${{ matrix.test }}
TestFromDate: ${{ matrix.year }}.01.01
TestPeriod: M1
TestSymbol: EURUSD
TestToDate: ${{ matrix.year }}.01.14
# yamllint disable-line rule:line-length
UrlExpert: file://${{ github.workspace }}/${{ env.TEST_PATH }}/${{ matrix.test }}.ex${{ matrix.version }}
Version: 5
- if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 20

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
47 changes: 36 additions & 11 deletions .github/workflows/test-exchange.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
name: Test Exchange

env:
TEST_PATH: Exchange/tests

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- 'Exchange/**.h'
- 'Exchange/**.mq?'
- '.github/workflows/test-exchange.yml'
- Exchange/**.h
- Exchange/**.mq?
push:
paths:
- 'Exchange/**.h'
- 'Exchange/**.mq?'
- '.github/workflows/test-exchange.yml'
- Exchange/**.h
- Exchange/**.mq?

jobs:

Expand All @@ -24,24 +27,46 @@ jobs:
path: Exchange/tests
skip_cleanup: true

Tests-MQL4:
test:
defaults:
run:
shell: bash
working-directory: Exchange/tests
if: false
working-directory: ${{ env.TEST_PATH }}
name: Test
needs: compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- Exchange.test
version: [5]
max-parallel: 4
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: files-ex4
name: files-ex${{ matrix.version }}
- name: List compiled files
run: find . -name '*.ex?' -type f -print
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
timeout-minutes: 10
Login: ${{ secrets.MT5_LOGIN }}
Password: ${{ secrets.MT5_PASSWORD }}
Server: MetaQuotes-Demo
TestDeposit: 2000
TestExpert: ${{ matrix.test }}
TestFromDate: ${{ matrix.year }}.01.01
TestPeriod: M1
TestSymbol: EURUSD
TestToDate: ${{ matrix.year }}.01.14
# yamllint disable-line rule:line-length
UrlExpert: file://${{ github.workspace }}/${{ env.TEST_PATH }}/${{ matrix.test }}.ex${{ matrix.version }}
Version: 5
- if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 20

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

0 comments on commit 37d96da

Please sign in to comment.