Skip to content

Commit

Permalink
Merge pull request #763 from EA31337/v3.008-dev-new-ci
Browse files Browse the repository at this point in the history
Merging origin/v3.006-dev into v3.008-dev-new with C++ and CI fixes
  • Loading branch information
kenorb authored Sep 8, 2024
2 parents 5ebdfa7 + 1b84393 commit fdb8e9b
Show file tree
Hide file tree
Showing 873 changed files with 16,947 additions and 9,229 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Check

# yamllint disable rule:truthy
# yamllint disable-line rule:truthy
on:
pull_request:
push:
Expand All @@ -10,6 +10,10 @@ jobs:
Pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: pre-commit/[email protected]
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
55 changes: 18 additions & 37 deletions .github/workflows/compile-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,31 @@ name: Compile C++
# yamllint disable-line rule:truthy
on:
pull_request:
paths-ignore:
- '**.md'
paths:
- '**.h'
- '**.mq?'
push:
paths-ignore:
- '**.md'
paths:
- '**.h'
- '**.mq?'

jobs:

FileList:
outputs:
filelist: ${{ steps.get-files.outputs.filelist }}
Compile-Cpp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set output with list of files
id: get-files
run: |
import glob, json, os
files = glob.glob("**/tests/*.cpp")
print("::set-output name=filelist::{}".format(json.dumps(files)))
shell: python
- name: Display output
run: echo ${{ steps.get-files.outputs.filelist }}

Compile:
runs-on: ubuntu-latest
needs: [FileList]
strategy:
matrix:
file: ${{ fromJson(needs.FileList.outputs.filelist) }}
steps:
- uses: actions/checkout@v2
- name: Install Emscripten toolchain
uses: mymindstorm/setup-emsdk@v11
- uses: actions/checkout@v3
- name: Install CPP compiler
uses: rlalik/[email protected]
with:
compiler: gcc-latest
- name: Compile ${{ matrix.file }} via emcc
if: always()
run: >
emcc -s WASM=1 -s ENVIRONMENT=node -s EXIT_RUNTIME=0 -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=1 -Wall -s
MODULARIZE=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 --bind -s EXPORTED_FUNCTIONS="[]" -g -std=c++17
"${{ matrix.file }}"
- name: Compile ${{ matrix.file }} via g++
if: always()
run: g++ -g -std=c++17 -c "${{ matrix.file }}"
- name: Compile via make
run: make
Compile-Emscripten:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Emscripten toolchain
uses: mymindstorm/setup-emsdk@v11
- name: Compile via emcc
run: make CC=emcc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Compile
name: Compile MQL

env:
ARTIFACT_PREFIX: ${{ inputs.artifact_prefix || 'mt' }}
Expand All @@ -11,6 +11,7 @@ on:
pull_request:
paths-ignore:
- '**.md'
- '.github/workflows/compile-mql.yml'
push:
paths-ignore:
- '**.md'
Expand Down Expand Up @@ -78,7 +79,7 @@ jobs:
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
shell: powershell
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: files-ex${{ matrix.version }}
path: '**/*.ex[45]'
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/lint.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/sync-fork.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Sync Fork

# yamllint disable rule:truthy
# yamllint disable-line rule:truthy
on:
push:
branches:
Expand All @@ -14,11 +14,11 @@ jobs:
if: github.repository != 'EA31337/EA31337-classes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
path: upstream
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/test-account.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/test-buffer.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/test-exchange-account.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
name: Test Exchange/Account

env:
TEST_PATH: Exchange/Account/tests
TEST_SKIP: ${{ secrets.MT5_LOGIN || false }}

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

jobs:

compile:
name: Compile
uses: ./.github/workflows/compile-mql.yml
with:
artifact_prefix: mt
path: Exchange/Account/tests
skip_cleanup: true

test:
defaults:
run:
shell: bash
working-directory: ${{ env.TEST_PATH }}
name: Test
needs: compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- Account.test
- AccountForex.test
- AccountMt.test
version: [5]
max-parallel: 4
steps:
- uses: actions/download-artifact@v4
with:
name: files-ex${{ matrix.version }}
- name: List compiled files
run: find . -name '*.ex?' -type f -print
- if: ${{ env.TEST_SKIP != true }}
name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
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() && runner.debug }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 20

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

0 comments on commit fdb8e9b

Please sign in to comment.