Skip to content

Commit 9872d00

Browse files
committed
CI: Fixes Compile workflow
1 parent ebd82d4 commit 9872d00

File tree

2 files changed

+51
-107
lines changed

2 files changed

+51
-107
lines changed

.github/workflows/backtest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@v2
3232
with:
3333
path: Include/EA31337-classes
34-
ref: v3.000.1
34+
ref: v3.000.2
3535
repository: EA31337/EA31337-classes
3636
- name: Enables input mode
3737
run: echo '#define __input__' > config/define.h
@@ -48,7 +48,7 @@ jobs:
4848
- uses: actions/checkout@v2
4949
with:
5050
path: indicators-other/Misc/Include/EA31337-classes
51-
ref: v3.000.1
51+
ref: v3.000.2
5252
repository: EA31337/EA31337-classes
5353
- name: Compile strategy for MQL5
5454
uses: fx31337/mql-compile-action@master
@@ -82,7 +82,7 @@ jobs:
8282
- uses: actions/checkout@v2
8383
with:
8484
path: Include/EA31337-classes
85-
ref: v3.000.1
85+
ref: v3.000.2
8686
repository: EA31337/EA31337-classes
8787
- name: Compile required indicator for MQL4
8888
if: false # MQL4 version not supported.

.github/workflows/compile.yml

Lines changed: 48 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
---
22
name: Compile
33

4-
# Setting an environment variable with the value of a configuration variable.
5-
env:
6-
ARTIFACT_PREFIX: ${{ inputs.artifact_prefix || 'mt' }}
7-
# yamllint disable-line rule:line-length
8-
CHECKOUT_BRANCH: ${{ inputs.checkout_branch || github.head_ref || github.ref_name }}
9-
INDI_OTHER_WORKDIR: ${{ vars.INDI_OTHER_WORKDIR || 'indicators-other' }}
10-
REPOSITORY: EA31337/EA31337-indicators-other
11-
SKIP_CLEANUP: ${{ inputs.skip_cleanup || false }}
12-
134
# yamllint disable-line rule:truthy
145
on:
156
pull_request:
@@ -27,29 +18,27 @@ on:
2718
- '*.md'
2819
- '.git*'
2920
workflow_call:
30-
inputs:
31-
artifact_prefix:
32-
default: mt
33-
description: Artifact prefix.
34-
required: false
35-
type: string
36-
checkout_branch:
37-
default: ${{ github.head_ref || github.ref_name }}
38-
description: Checkout branch
39-
required: false
40-
type: string
41-
skip_cleanup:
42-
default: false
43-
description: Whether to skip a clean-up job.
44-
required: false
45-
type: boolean
4621

4722
jobs:
23+
checkout-classes:
24+
name: Checkout Classes repo
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
ref: v3.000.2
30+
repository: EA31337/EA31337-classes
31+
- name: Uploads source code
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: src-classes
35+
path: .
36+
4837
mt4:
4938
name: Installs platform (4)
5039
uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev
5140
with:
52-
artifact_name: ${{ inputs.artifact_prefix || 'mt' }}4
41+
artifact_name: .mt4
5342
artifact_overwrite: true
5443
skip_cleanup: true
5544
version: 4
@@ -58,113 +47,68 @@ jobs:
5847
name: Installs platform (5)
5948
uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev
6049
with:
61-
artifact_name: ${{ inputs.artifact_prefix || 'mt' }}5
50+
artifact_name: .mt5
6251
artifact_overwrite: true
6352
skip_cleanup: true
6453
version: 5
6554

66-
compile-platform-indicators:
55+
compile:
6756
defaults:
6857
run:
6958
shell: powershell
70-
name: Compile platform indicators
71-
needs: [mt4, mt5]
59+
name: Compile
60+
needs: [checkout-classes, mt4, mt5]
7261
runs-on: windows-latest
73-
strategy:
74-
matrix:
75-
version: [4, 5]
76-
steps:
77-
- uses: actions/download-artifact@v4
78-
with:
79-
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
80-
path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
81-
- name: Compile MQL
82-
uses: fx31337/mql-compile-action@dev
83-
with:
84-
include: .
85-
init-platform: true
86-
mt-path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
87-
# yamllint disable-line rule:line-length
88-
path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}/**/MQL?/Indicators
89-
verbose: true
90-
- name: Copy MQL to the current location
91-
run: >-
92-
Copy-Item
93-
-Path ".${{ env.ARTIFACT_PREFIX }}*\*\*\MQL?"
94-
-Destination .
95-
-Recurse
96-
-Verbose
97-
- name: List all source code files
98-
run: '(Get-ChildItem -Recurse -Path "MQL?" -Include *.mq[45]).fullname'
99-
- name: List compiled files
100-
run: '(Get-ChildItem -Recurse -Path "MQL?" -Include *.ex[45]).fullname'
101-
- name: Upload platform indicators
102-
uses: actions/upload-artifact@v4
103-
with:
104-
if-no-files-found: error
105-
name: ${{ env.ARTIFACT_PREFIX }}-indicators-ex${{ matrix.version }}
106-
path: MQL?/**/*.[me][qx][45h]
107-
- if: ${{ failure() }}
108-
uses: mxschmitt/action-tmate@v3
109-
timeout-minutes: 20
110-
111-
compile-indicators:
112-
defaults:
113-
run:
114-
shell: powershell
115-
name: Compile Indicators
116-
needs: [compile-platform-indicators]
117-
runs-on: windows-latest
118-
strategy:
119-
matrix:
120-
version: [4, 5]
12162
steps:
12263
- uses: actions/checkout@v4
12364
with:
124-
path: ${{ env.INDI_OTHER_WORKDIR }}
125-
ref: ${{ env.CHECKOUT_BRANCH }}
126-
repository: EA31337/EA31337-indicators-other
127-
- uses: actions/checkout@v4
128-
with:
129-
path: MQL${{ matrix.version}}/Include/EA31337-classes
130-
ref: v3.000.1
131-
repository: EA31337/EA31337-classes
65+
submodules: recursive
13266
- uses: actions/download-artifact@v4
13367
with:
134-
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
135-
path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
68+
name: src-classes
69+
path: Include/EA31337-classes
13670
- uses: actions/download-artifact@v4
13771
with:
138-
merge-multiple: true
139-
pattern: ${{ env.ARTIFACT_PREFIX }}-indicators-ex?
140-
- name: List all source code files
141-
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname'
142-
- name: List compiled files
143-
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
72+
pattern: .mt?
73+
- name: Enables input mode
74+
run: echo '#define __input__' >> config/define.h
75+
- name: Compile indicators
76+
uses: fx31337/mql-compile-action@master
77+
with:
78+
include: .
79+
mt-path: .mt${{ matrix.version }}
80+
path: indicators-other/**/*.[me][qx][45h]
81+
verbose: true
14482
- name: Compile
14583
uses: fx31337/mql-compile-action@master
14684
with:
147-
include: MQL${{ matrix.version }}
148-
mt-path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
149-
path: ${{ env.INDI_OTHER_WORKDIR }}/**/*.mq${{ matrix.version }}
85+
include: .
86+
mt-path: .mt${{ matrix.version }}
87+
path: "**/Stg_*.mq${{ matrix.version }}"
15088
verbose: true
15189
- name: List compiled files
15290
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
15391
- run: Get-Location
154-
- name: Upload indicator artifacts
92+
- name: Upload artifacts
15593
uses: actions/upload-artifact@v4
15694
with:
157-
# yamllint disable-line rule:line-length
158-
name: ${{ env.ARTIFACT_PREFIX }}-indicators-other-ex${{ matrix.version }}
159-
path: ${{ env.INDI_OTHER_WORKDIR }}/**/*.ex[45]
160-
timeout-minutes: 30
95+
if-no-files-found: error
96+
name: Strategy
97+
path: '**/Stg_*.ex[45]'
98+
strategy:
99+
matrix:
100+
version:
101+
- 4
102+
- 5
103+
max-parallel: 2
104+
timeout-minutes: 10
161105

162106
cleanup:
163107
if: inputs.skip_cleanup != true
164108
name: Clean-up
165-
needs: [compile-indicators]
109+
needs: [compile]
166110
runs-on: ubuntu-latest
167111
steps:
168112
- uses: geekyeggo/delete-artifact@v5
169113
with:
170-
name: ${{ env.ARTIFACT_PREFIX }}*
114+
name: .mt?

0 commit comments

Comments
 (0)