|
1 | 1 | --- |
2 | 2 | name: Compile |
3 | 3 |
|
| 4 | +env: |
| 5 | + ARTIFACT_PREFIX: ${{ inputs.artifact_prefix || 'mt' }} |
| 6 | + REPOSITORY: EA31337/EA31337-Libre |
| 7 | + SKIP_CLEANUP: ${{ inputs.skip_cleanup || false }} |
| 8 | + |
4 | 9 | # yamllint disable-line rule:truthy |
5 | 10 | on: |
6 | 11 | pull_request: |
| 12 | + branches: |
| 13 | + - 'master' |
| 14 | + - '*dev*' |
7 | 15 | paths-ignore: |
8 | | - - '**.md' |
| 16 | + - '*.md' |
| 17 | + - '.git*' |
9 | 18 | push: |
| 19 | + branches: |
| 20 | + - 'master' |
| 21 | + - '*dev*' |
10 | 22 | paths-ignore: |
11 | | - - '**.md' |
| 23 | + - '*.md' |
| 24 | + - '.git*' |
| 25 | + workflow_call: |
| 26 | + inputs: |
| 27 | + artifact_prefix: |
| 28 | + default: mt |
| 29 | + description: Artifact prefix. |
| 30 | + required: false |
| 31 | + type: string |
| 32 | + skip_cleanup: |
| 33 | + default: false |
| 34 | + description: Whether to skip a clean-up job. |
| 35 | + required: false |
| 36 | + type: boolean |
12 | 37 |
|
13 | 38 | jobs: |
14 | | - Compile: |
| 39 | + checkout: |
| 40 | + name: Checkout |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + with: |
| 45 | + submodules: recursive |
| 46 | + - name: Uploads source code |
| 47 | + uses: actions/upload-artifact@v4 |
| 48 | + with: |
| 49 | + name: src |
| 50 | + path: src |
| 51 | + mt4: |
| 52 | + name: Installs platform (4) |
| 53 | + uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev |
| 54 | + with: |
| 55 | + artifact_name: ${{ inputs.artifact_prefix || 'mt' }}4 |
| 56 | + artifact_overwrite: true |
| 57 | + skip_cleanup: true |
| 58 | + version: 4 |
| 59 | + |
| 60 | + mt5: |
| 61 | + name: Installs platform (5) |
| 62 | + uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev |
| 63 | + with: |
| 64 | + artifact_name: ${{ inputs.artifact_prefix || 'mt' }}5 |
| 65 | + artifact_overwrite: true |
| 66 | + skip_cleanup: true |
| 67 | + version: 5 |
| 68 | + |
| 69 | + compile-ea: |
15 | 70 | defaults: |
16 | 71 | run: |
17 | 72 | shell: powershell |
18 | | - working-directory: src |
| 73 | + name: Compile EA |
| 74 | + needs: [checkout, mt4, mt5] |
19 | 75 | runs-on: windows-latest |
20 | 76 | steps: |
21 | | - - uses: actions/checkout@v2 |
22 | | - - uses: actions/checkout@v2 |
| 77 | + - uses: actions/download-artifact@v4 |
23 | 78 | with: |
24 | | - submodules: recursive |
25 | | - - name: List MQL files |
26 | | - run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname' |
27 | | - shell: powershell |
28 | | - - name: Compiles EA (MQL4) |
29 | | - uses: fx31337/mql-compile-action@master |
| 79 | + name: src |
| 80 | + path: src |
| 81 | + - uses: actions/download-artifact@v4 |
30 | 82 | with: |
31 | | - path: src\EA31337-Libre.mq4 |
32 | | - verbose: true |
33 | | - |
34 | | - - name: Compiles EA (MQL5) |
| 83 | + name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.version }} |
| 84 | + path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }} |
| 85 | + - name: List all source code files |
| 86 | + run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname' |
| 87 | + - name: List compiled files |
| 88 | + run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' |
| 89 | + - name: Compiles EA |
35 | 90 | uses: fx31337/mql-compile-action@master |
36 | 91 | with: |
37 | | - path: src\EA31337-Libre.mq5 |
| 92 | + mt-path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }} |
| 93 | + path: src\EA31337-Libre.mq${{ matrix.version }} |
38 | 94 | verbose: true |
39 | 95 | - name: List compiled files |
40 | 96 | run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' |
41 | | - |
| 97 | + - run: Get-Location |
42 | 98 | - name: Upload artifacts |
43 | | - uses: actions/upload-artifact@v2 |
| 99 | + uses: actions/upload-artifact@v4 |
| 100 | + with: |
| 101 | + name: EA-Libre.ex${{ matrix.version }} |
| 102 | + path: src/*.ex? |
| 103 | + strategy: |
| 104 | + matrix: |
| 105 | + version: [4, 5] |
| 106 | + timeout-minutes: 30 |
| 107 | + |
| 108 | + cleanup: |
| 109 | + if: inputs.skip_cleanup != true |
| 110 | + name: Clean-up |
| 111 | + needs: [compile-ea] |
| 112 | + runs-on: ubuntu-latest |
| 113 | + steps: |
| 114 | + - uses: geekyeggo/delete-artifact@v5 |
44 | 115 | with: |
45 | | - name: EA |
46 | | - path: 'src/*.ex?' |
| 116 | + name: ${{ env.ARTIFACT_PREFIX }}* |
0 commit comments