Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EA Tester refactor #234

Merged
merged 101 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
2622c14
Updates MT_VER
kenorb Nov 12, 2023
b3ddd1d
pre-commit autoupdate
kenorb Jan 16, 2024
d6fc67d
Upgrades container image to ubuntu:bionic
kenorb Jan 16, 2024
90900e3
Installs gnupg during provisioning
kenorb Jan 16, 2024
03a6788
Removes python-software-properties
kenorb Jan 16, 2024
362c000
Installs MT4 and MT5 by installer
kenorb Jan 16, 2024
742c55b
Provision mono
kenorb Jan 16, 2024
4c51c52
tests/test_compile.sh: Installs MT4 and MT5 by installer
kenorb Jan 16, 2024
cb2a2e6
Installs mono-complete
kenorb Jan 17, 2024
28dc4af
tests/test_backtest.sh: Installs MT4 and MT5 by installer
kenorb Jan 17, 2024
281f67c
Verb improvements
kenorb Jan 27, 2024
8761ed8
Installs platform via Ansible
kenorb Jan 27, 2024
6212570
Improves installation steps
kenorb Jan 28, 2024
3dd73c1
Uses ubuntu:jammy by default
kenorb Jan 28, 2024
f19182e
Installs git
kenorb Jan 28, 2024
609053d
Uses rm to clean /tmp
kenorb Jan 28, 2024
4f8eecb
Renames mt-install.yml to install-mt.yml
kenorb Jan 28, 2024
ec920c2
Simplifies Dockerfile
kenorb Jan 28, 2024
b78787a
Improves install scripts by using verb files
kenorb Jan 28, 2024
fd118c2
Removes clean ups from Dockerfile
kenorb Jan 28, 2024
818e285
install-wine: Adds wine_install_winetricks
kenorb Jan 28, 2024
50dc204
Installs Xvfb
kenorb Jan 28, 2024
29745b5
Removes redundant targets
kenorb Jan 28, 2024
fa70506
Installs winetricks from master
kenorb Jan 28, 2024
40e3e31
Adds galaxy-requirements.yml
kenorb Feb 5, 2024
1b33fd0
GHA: Installs platform via Ansible
kenorb Feb 5, 2024
925a7c1
GHA: Compile: Sets mt-path
kenorb Feb 5, 2024
a1309b7
Re-adds missing playbooks
kenorb Feb 5, 2024
4deb8e0
GHA: Testing mt-path with env.GITHUB_HOME
kenorb Feb 5, 2024
c950ecf
GHA: Compile: Updates mt-path
kenorb Feb 5, 2024
2fddd5f
Installs ansible via pip
kenorb Feb 7, 2024
6a43cef
Removes install_mt4x.sh as redundant
kenorb Feb 10, 2024
d50ce2c
Improves platform installation scripts
kenorb Feb 10, 2024
5747dbb
Installs winetricks via ansible
kenorb Feb 10, 2024
30385a2
Improves ansible-galaxy to install requirements
kenorb Feb 10, 2024
e47a7a0
Improves ansible-galaxy requirements logic
kenorb Feb 10, 2024
abd92d2
Installs Ansible Galaxy requirements in install scripts as well
kenorb Feb 10, 2024
c3327a5
GHA: tests-shell: Adds volumes to container
kenorb Feb 10, 2024
5d05a47
GHA: tests-shell: Adds options: --user root
kenorb Feb 10, 2024
ff70442
GHA: tests-shell: Adds GIT_CEILING_DIRECTORIES
kenorb Feb 10, 2024
e5ff3cd
Adds: git config --global --add safe.directory /__w
kenorb Feb 10, 2024
c673323
GHA: test_backtest: Prints errors with tail
kenorb Feb 10, 2024
45f6765
GHA: Sets WINEPREFIX to /tmp
kenorb Feb 10, 2024
4df2c1c
GHA: tests-shell: Adds env.PATH
kenorb Feb 10, 2024
bdab459
Renames WINE_PATH to WINEPREFIX
kenorb Feb 10, 2024
2c9c973
GHA: Improves environmental variables
kenorb Feb 10, 2024
5667c63
GHA: tests-shell: Corrects volumes
kenorb Feb 10, 2024
d6ccc84
GHA: tests-shell: Removes adding safe.directory step
kenorb Feb 10, 2024
e6d404d
GHA: tests-shell: Adds env.PATH to run step
kenorb Feb 10, 2024
e83343b
GHA: Minor improvements
kenorb Feb 10, 2024
0db0e76
GHA: Adds with.path to checkout git repo to github.workspace
kenorb Feb 10, 2024
412c65f
Revert "GHA: Minor improvements"
kenorb Feb 10, 2024
93777b7
GHA: Runs find /opt -print
kenorb Feb 10, 2024
e7e1e87
Removes git init from provisioning script
kenorb Feb 10, 2024
4100bbb
Uses GITHUB_WORKSPACE instead of github.workspace
kenorb Feb 10, 2024
a5d453c
Testing usage of env.GITHUB_WORKSPACE
kenorb Feb 10, 2024
b735bd3
Hardcoding path due to bug
kenorb Feb 10, 2024
17ddf95
GHA: Uses symbolic link to resolve the issue with missing scripts dir…
kenorb Feb 10, 2024
0ad4956
GHA: Upgrades actions/checkout to v4
kenorb Feb 10, 2024
5419bf1
Re-adds git install to provision script
kenorb Feb 10, 2024
fbad609
Installs x11-utils by default
kenorb Feb 10, 2024
3374079
Moves wine_install_winetricks to playbook
kenorb Feb 10, 2024
dfff3a4
GHA: Sets timeout-minutes to 20 minutes
kenorb Feb 11, 2024
6feb47d
Corrects platform installation scripts
kenorb Feb 11, 2024
ad96834
Corrects playbook syntax with variables
kenorb Feb 11, 2024
716a8fe
Adds install-mt5.yml
kenorb Feb 11, 2024
616c0fa
Removes verb files as redundant
kenorb Feb 11, 2024
7973093
scripts/install_mt4: Corrects typo
kenorb Feb 11, 2024
5757b13
Installs required utils via Ansible
kenorb Feb 11, 2024
80b05ec
scripts/install_mt4: Corrects another typo
kenorb Feb 11, 2024
b9daf01
test_backtest: Improves stdout handling
kenorb Feb 11, 2024
142e9cf
GHA: Adds platform.yml workflow
kenorb Feb 11, 2024
60e61a7
GHA: Do not run docker workflow for .github path changes
kenorb Feb 11, 2024
05d7aed
GHA: Adds actions/checkout to platform workflow
kenorb Feb 11, 2024
57e20ed
GHA: Platform: Improves name of job
kenorb Feb 11, 2024
9d10a02
GHA: Updates if condition for clean-up
kenorb Feb 11, 2024
34f31fa
GHA: Checking if $VERSION can work
kenorb Feb 11, 2024
8446ce6
GHA Corrects cleanup if condition
kenorb Feb 11, 2024
a86d989
GHA: Removes ${VERSION} from name as it does not work
kenorb Feb 11, 2024
4255213
Renames platform to platform-linux
kenorb Feb 11, 2024
bad2b1e
GHA: Runs clean-up job when inputs are empty
kenorb Feb 11, 2024
d9ed76d
GHA: Fixes clean-up if condition
kenorb Feb 11, 2024
8dfcaa4
GHA: Testing new cleanup if condition
kenorb Feb 11, 2024
329f295
GHA: Corrects paths
kenorb Feb 11, 2024
6faaa6f
GHA: Testing new if condition for cleanup
kenorb Feb 11, 2024
1c862c8
GHA: Adds inputs.cleanup
kenorb Feb 11, 2024
fd0a217
GHA: Adds if github.repository condition
kenorb Feb 11, 2024
8b1cc37
Adds artifact_overwrite workflow input
kenorb Feb 17, 2024
421fc6e
GHA: Renames artifact input to artifact_name
kenorb Feb 17, 2024
6b52cdc
GHA: Adds support for cache
kenorb Apr 21, 2024
9e56a6e
GHA: Improves cache key
kenorb Apr 21, 2024
fea4878
GHA: Adds hashFiles() to cache key
kenorb Apr 21, 2024
93c67aa
Revert "GHA: Adds hashFiles() to cache key"
kenorb Apr 21, 2024
ee91fcb
GHA: Drops artifact name from the cache key
kenorb Apr 21, 2024
1685745
GHA: Improves cache key by adding hash of the workflow file
kenorb Apr 21, 2024
0a4f11a
GHA: platform-linux: Renames cleanup input to skip_cleanup
kenorb Apr 22, 2024
900a453
GHA: platform-linux: Adds /etc/ansible/facts.d to the caching path list
kenorb Apr 22, 2024
6e40fad
GHA: platform-linux: Adds support for outputs
kenorb Apr 22, 2024
7297ef1
GHA: Upgrades geekyeggo/delete-artifact to v5 due to bug
kenorb Apr 23, 2024
f00bdf5
Revert "GHA: platform-linux: Adds /etc/ansible/facts.d to the caching…
kenorb Apr 23, 2024
0dc9e73
Converts docker-compose to docker compose
kenorb Sep 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
Pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,45 @@ on:
push:
branches:
- 'master'
- 'ci'
- '*dev*'
paths:
- '**/*.mq?'
- '.github/workflows/compile.yml'

jobs:
Compile:
runs-on: windows-latest
Compile-MT4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: fx31337/mql-compile-action@master
- uses: actions/checkout@v4
- name: Installs platform
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: install-mt4.yml
directory: ./ansible
options: |
--connection local
--inventory localhost,
--verbose
requirements: galaxy-requirements.yml
- uses: fx31337/mql-compile-action@dev
with:
mt-path: ${{ github.workspace }}/../../../.wine/drive_c
verbose: true
Compile-MT5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Installs platform
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: install-mt5.yml
directory: ./ansible
options: |
--connection local
--inventory localhost,
--verbose
requirements: galaxy-requirements.yml
- uses: fx31337/mql-compile-action@dev
with:
mt-path: ${{ github.workspace }}/../../../.wine/drive_c
verbose: true
13 changes: 4 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- '**/*.md'
- '**/*.txt'
- '.*'
- '.github/**'
# Sequence of patterns matched against refs/tags.
tags:
- 'v1.*'
Expand All @@ -27,31 +28,25 @@ jobs:
Hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: brpaz/hadolint-action@master
with:
dockerfile: Dockerfile
Docker:
runs-on: ubuntu-latest
needs: Hadolint
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build ubuntu-base
run: docker build --target ubuntu-base -t ubuntu-base .
- name: Build ubuntu-provisioned
run: docker build --target ubuntu-provisioned -t ubuntu-provisioned .
- name: Build ea-tester-base
run: docker build --target ea-tester-base -t ea-tester-base .
- name: Build ea-tester-with-mt4
run: docker build --target ea-tester-with-mt4 -t mt4 .
- name: Build ea-tester-with-mt5
run: docker build --target ea-tester-with-mt5 -t mt5 .
- name: Build ea-tester
run: docker build
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
--build-arg VCS_REF=${GITHUB_SHA}
--build-arg VERSION=${GITHUB_REF}
--target ea-tester .
--target ea-tester-base .
- run: docker images
- name: Print GitHub actor, repository and ref
run: echo "${{ github.actor }} @ ${{ github.repository }}:${{ github.ref }}"
Expand Down
114 changes: 114 additions & 0 deletions .github/workflows/platform-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
name: Platform (Linux)

env:
ARTIFACT_NAME: ${{ inputs.artifact_name || 'platform' }}
ARTIFACT_OVERWRITE: ${{ inputs.artifact_overwrite || false }}
CACHE: ${{ inputs.cache || true }}
CHECKOUT_REF: ${{ inputs.ref || 'dev' }}
REPOSITORY: EA31337/EA-Tester
SKIP_CLEANUP: ${{ inputs.skip_cleanup || false }}
VERSION: ${{ inputs.version || 5 }}

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- '.github/workflows/platform-linux.yml'
push:
branches:
- 'master'
- '*dev*'
paths:
- '.github/workflows/platform-linux.yml'
workflow_call:
inputs:
artifact_name:
default: platform
description: Artifact name.
required: false
type: string
artifact_overwrite:
default: false
description: Whether to overwrite artifact.
required: false
type: boolean
cache:
default: true
description: Whether to use cache.
required: false
type: boolean
ref:
default: dev
description: The branch, tag or SHA to checkout.
required: false
type: string
skip_cleanup:
default: false
description: Whether to skip a clean-up job.
required: false
type: boolean
version:
default: 5
description: Version to install.
type: number
# Map the workflow outputs to job outputs.
outputs:
platform:
description: Platform fact output.
value: ${{ jobs.platform-linux.outputs.platform || '{}' }}

jobs:
platform-linux:
name: Platform
# Map the job outputs to step outputs.
outputs:
platform: ${{ steps.out-mt-fact.outputs.platform }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.CHECKOUT_REF }}
repository: ${{ env.REPOSITORY }}
- id: cache-mt
if: env.CACHE
uses: actions/cache@v4
with:
path: ~/.wine/drive_c
key: ${{ env.CHECKOUT_REF }}/${{ env.VERSION }}/${{ hashFiles('.github/workflows/platform-linux.yml') }}
- if: steps.cache-mt.outputs.cache-hit != 'true'
name: Runs playbook
uses: dawidd6/action-ansible-playbook@v2
with:
configuration: |
[defaults]
nocows = false
stdout_callback = yaml
directory: ansible
options: |
--connection local
--inventory localhost,
--verbose
playbook: install-mt${{ env.VERSION }}.yml
requirements: galaxy-requirements.yml
- id: out-mt-fact
name: Sets output
run: echo "platform=$(cat /etc/ansible/facts.d/metatrader.fact)" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}
path: |
~/.wine/drive_c/Program Files*/**/*MT*
~/.wine/drive_c/Program Files*/**/*Meta*
overwrite: ${{ env.ARTIFACT_OVERWRITE }}
timeout-minutes: 20
cleanup:
if: inputs.skip_cleanup != true
name: Clean-up
needs: [platform-linux]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.ARTIFACT_NAME }}
4 changes: 2 additions & 2 deletions .github/workflows/sync-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
if: github.repository != 'EA31337/EA-Tester'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: upstream
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests-mql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ jobs:
- TestModellingQuality
- TestTimeframes
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check dependencies
if: github.actor == 'nektos/act'
run: >
apt-get update
&& apt-get -qq install python-pip
&& pip install docker-compose
- name: Run ${{ matrix.test }}
run: docker-compose run ${{ matrix.test }}
run: docker compose run ${{ matrix.test }}
Tests-MT4-Ignored:
defaults:
run:
Expand All @@ -61,12 +61,12 @@ jobs:
- TestLotstep5 # @fixme: GH-208
- TestSpread # @fixme: GH-209
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check dependencies
if: github.actor == 'nektos/act'
run: >
apt-get update
&& apt-get -qq install python-pip
&& pip install docker-compose
- name: Run ${{ matrix.test }}
run: docker-compose run ${{ matrix.test }} || true
run: docker compose run ${{ matrix.test }} || true
15 changes: 14 additions & 1 deletion .github/workflows/tests-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ jobs:
env:
OPT_TRACE: ${{ runner.debug }}
OPT_VERBOSE: true
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/scripts:/opt/scripts/py
# Refs: https://stackoverflow.com/q/16818101/55075
WINEPREFIX: /tmp/.wine
image: ea31337/ea-tester:dev
options: --user root
strategy:
matrix:
test:
Expand All @@ -35,5 +39,14 @@ jobs:
- ./test_eval.sh
- ./test_vars.sh
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
env:
# Refs: https://github.com/actions/checkout/issues/956
GIT_CEILING_DIRECTORIES: /__w
- name: Link scripts directory to /opt/scripts
run: ln -fsv /__w/EA-Tester/EA-Tester/scripts /opt/scripts
- run: find /__w /opt -print
- run: ${{ matrix.test }}
env:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/scripts:/opt/scripts/py
timeout-minutes: 20
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
repos:

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.27.1
rev: v1.33.0
hooks:
- id: yamllint
args: ["-c", ".yamllint", "-s"]
Expand All @@ -24,7 +24,7 @@ repos:
# files: '(\.py)$'

- repo: https://github.com/igorshubovych/markdownlint-cli.git
rev: v0.32.1
rev: v0.38.0
hooks:
- id: markdownlint

Expand All @@ -41,7 +41,7 @@ repos:
- id: shfmt

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand Down
Loading
Loading