From 2622c14ecb80001e4d4c68089f08a72a0d142fc2 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 12 Nov 2023 17:07:37 +0000 Subject: [PATCH 001/101] Updates MT_VER --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 60e82e0f..f3cd3a7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ VOLUME $BT_DEST FROM ea-tester-base AS ea-tester-with-mt4 # Install platform. -ARG MT_VER=4.0.0.1382 +ARG MT_VER=4 RUN eval.sh install_mt $MT_VER && \ run_backtest.sh -s PrintPaths -v @@ -66,7 +66,7 @@ RUN eval.sh clean_bt && \ FROM ea-tester-base AS ea-tester-with-mt5 # Install platform. -ARG MT_VER=5.0.0.3802 +ARG MT_VER=5 ENV MT_VER $MT_VER RUN eval.sh install_mt $MT_VER #RUN run_backtest.sh -s PrintPaths -v From b3ddd1d0cc97fd5baa9cf322376b47318b93f9af Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 16 Jan 2024 23:19:32 +0000 Subject: [PATCH 002/101] pre-commit autoupdate --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87be1ca3..cb7d1542 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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"] @@ -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 @@ -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 From d6fc67dfd6d3230261ed58436e6e4f688020066e Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 16 Jan 2024 23:22:07 +0000 Subject: [PATCH 003/101] Upgrades container image to ubuntu:bionic --- Dockerfile | 2 +- scripts/provision.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f3cd3a7f..a2ea1af7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base Ubuntu image. -FROM ubuntu:xenial AS ubuntu-base +FROM ubuntu:bionic AS ubuntu-base ENV DEBIAN_FRONTEND noninteractive # Setup the default user. diff --git a/scripts/provision.sh b/scripts/provision.sh index 5b7caca6..4b817e40 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -116,7 +116,7 @@ case "$(uname -s)" in # APT dependencies (for the add-apt-repository). command -v add-apt-repository || apt-get install -qq software-properties-common python-software-properties # Adds APT Wine repository. - add-apt-repository -y "deb http://dl.winehq.org/wine-builds/ubuntu/ ${DISTRIB_CODENAME:-xenial} main" + add-apt-repository -y "deb http://dl.winehq.org/wine-builds/ubuntu/ ${DISTRIB_CODENAME:-bionic} main" # Install Charles proxy. if (("$PROVISION_CHARLES")); then From 90900e3049ef1450000d90e534530d9b9b8ec6f9 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 16 Jan 2024 23:30:12 +0000 Subject: [PATCH 004/101] Installs gnupg during provisioning --- scripts/provision.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index 4b817e40..c7b5cbee 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -107,8 +107,8 @@ case "$(uname -s)" in command -v wget &> /dev/null || apt-get install -qq wget # CA certificates to allow SSL-based applications to check for the authenticity of SSL connections. - echo "Installing CA certificates..." >&2 - apt-get install -qq ca-certificates + echo "Installing CA certificates and GnuPG..." >&2 + apt-get install -qq ca-certificates gnupg # Add PPA/Wine repository. echo "Adding PPA/Wine repository..." >&2 # Adds GPG release key. From 03a6788f9b091942e5540d86e8a9fdd8407bbf1a Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 16 Jan 2024 23:42:44 +0000 Subject: [PATCH 005/101] Removes python-software-properties Fixes E: Package 'python-software-properties' has no installation candidate --- scripts/provision.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index c7b5cbee..9ac6e197 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -114,7 +114,7 @@ case "$(uname -s)" in # Adds GPG release key. apt-key add < <(curl -S https://dl.winehq.org/wine-builds/winehq.key) # APT dependencies (for the add-apt-repository). - command -v add-apt-repository || apt-get install -qq software-properties-common python-software-properties + command -v add-apt-repository || apt-get install -qq software-properties-common # Adds APT Wine repository. add-apt-repository -y "deb http://dl.winehq.org/wine-builds/ubuntu/ ${DISTRIB_CODENAME:-bionic} main" From 362c00064e1a55968ca684a00527fb96a6f44927 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 16 Jan 2024 23:49:41 +0000 Subject: [PATCH 006/101] Installs MT4 and MT5 by installer --- scripts/tests/test_cmds.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tests/test_cmds.sh b/scripts/tests/test_cmds.sh index 46857d07..79aa6693 100755 --- a/scripts/tests/test_cmds.sh +++ b/scripts/tests/test_cmds.sh @@ -13,8 +13,8 @@ initialize help | grep "Usage" > /dev/null # Installs both platforms. -install_mt 4.0.0.1280 /opt -install_mt 5.0.0.2361 /opt +install_mt 4 /opt +install_mt 5 /opt # Load variables. . ../.vars.inc.sh From 742c55bf201e84de22955957893f782ce3fda7f6 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 16 Jan 2024 23:54:38 +0000 Subject: [PATCH 007/101] Provision mono --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a2ea1af7..f79511b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ARG HTTPS_PROXY ARG HTTP_PROXY ARG PROVISION_AHK=0 ARG PROVISION_CHARLES=0 -ARG PROVISION_MONO=0 +ARG PROVISION_MONO=1 ARG PROVISION_SSH=0 ARG PROVISION_SUDO=1 ARG PROVISION_VNC=1 From 4c51c529b624e15fdfa00b31f00a54e952a1ad32 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 16 Jan 2024 23:55:45 +0000 Subject: [PATCH 008/101] tests/test_compile.sh: Installs MT4 and MT5 by installer --- scripts/tests/test_compile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tests/test_compile.sh b/scripts/tests/test_compile.sh index ba83407b..70069c2c 100755 --- a/scripts/tests/test_compile.sh +++ b/scripts/tests/test_compile.sh @@ -10,8 +10,8 @@ initialize . ../.funcs.cmds.inc.sh # Installs both platforms. -install_mt 4.0.0.1280 /opt -install_mt 5.0.0.2361 /opt +install_mt 4 /opt +install_mt 5 /opt # Load variables. . ../.vars.inc.sh From cb2a2e6de94d9b4e64f38e46bad193a8cc3d7ef7 Mon Sep 17 00:00:00 2001 From: kenorb Date: Wed, 17 Jan 2024 00:06:10 +0000 Subject: [PATCH 009/101] Installs mono-complete Upgrades wine-mono to 8.1.0 --- scripts/provision-colab.sh | 8 ++++---- scripts/provision.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/provision-colab.sh b/scripts/provision-colab.sh index e393a0af..aa83cdda 100755 --- a/scripts/provision-colab.sh +++ b/scripts/provision-colab.sh @@ -145,16 +145,16 @@ case "$(uname -s)" in # Install Mono. if (("$PROVISION_MONO")); then - echo "Installing Wine Mono..." >&2 - apt-get install -qq wine-mono + echo "Installing Mono..." >&2 + apt-get install -qq mono-complete su - $user -c " set -x export DISPLAY=:1.0 export WINEDLLOVERRIDES=mscoree,mshtml= echo \$DISPLAY xdpyinfo &>/dev/null || (! pgrep -a Xvfb && Xvfb \$DISPLAY -screen 0 1024x768x16) & - wget -qP /tmp -nc 'http://dl.winehq.org/wine/wine-mono/4.8.3/wine-mono-4.8.3.msi' && \ - wine64 msiexec /i /tmp/wine-mono-4.8.3.msi + wget -qP /tmp -nc 'http://dl.winehq.org/wine/wine-mono/8.1.0/wine-mono-8.1.0-x86.msi' && \ + wine64 msiexec /i /tmp/wine-mono-8.1.0-x86.msi rm -v /tmp/*.msi && \ (pkill Xvfb || true) " diff --git a/scripts/provision.sh b/scripts/provision.sh index 9ac6e197..456d3748 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -185,16 +185,16 @@ case "$(uname -s)" in # Install Mono. if (("$PROVISION_MONO")); then - echo "Installing Wine Mono..." >&2 - apt-get install -qq wine-mono + echo "Installing Mono..." >&2 + apt-get install -qq mono-complete su - $user -c " set -x export DISPLAY=:1.0 export WINEDLLOVERRIDES=mscoree,mshtml= echo \$DISPLAY xdpyinfo &>/dev/null || (! pgrep -a Xvfb && Xvfb \$DISPLAY -screen 0 1024x768x16) & - wget -qP /tmp -nc 'http://dl.winehq.org/wine/wine-mono/4.8.3/wine-mono-4.8.3.msi' && \ - wine64 msiexec /i /tmp/wine-mono-4.8.3.msi + wget -qP /tmp -nc 'http://dl.winehq.org/wine/wine-mono/8.1.0/wine-mono-8.1.0-x86.msi' && \ + wine64 msiexec /i /tmp/wine-mono-8.1.0-x86.msi rm -v /tmp/*.msi && \ (pkill Xvfb || true) " From 28dc4af7fc81074577bb0a83153c6c10c6ef831e Mon Sep 17 00:00:00 2001 From: kenorb Date: Wed, 17 Jan 2024 00:14:30 +0000 Subject: [PATCH 010/101] tests/test_backtest.sh: Installs MT4 and MT5 by installer --- scripts/tests/test_backtest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tests/test_backtest.sh b/scripts/tests/test_backtest.sh index b02ab34f..73a426ff 100755 --- a/scripts/tests/test_backtest.sh +++ b/scripts/tests/test_backtest.sh @@ -24,8 +24,8 @@ export RUN_ON_ERROR="tail $file_stdout $file_stderr" ## START TESTS # Installs both platforms. -install_mt 4.0.0.1280 /opt 1> $file_stdout 2> $file_stderr -install_mt 5.0.0.2361 /opt 1> $file_stdout 2> $file_stderr +install_mt 4 /opt 1> $file_stdout 2> $file_stderr +install_mt 5 /opt 1> $file_stdout 2> $file_stderr ## Checks backtest with missing parameters. ! run_backtest -_ 1> $file_stdout 2> $file_stderr From 281f67c15b6d6b9f930f82da0a0a2b7be387f163 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 27 Jan 2024 22:37:44 +0000 Subject: [PATCH 011/101] Verb improvements --- scripts/verb/install_mt4.verb | 6 +++--- scripts/verb/install_mt5.verb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/verb/install_mt4.verb b/scripts/verb/install_mt4.verb index 0797be2a..9ec86138 100644 --- a/scripts/verb/install_mt4.verb +++ b/scripts/verb/install_mt4.verb @@ -1,11 +1,11 @@ #!/bin/sh -w_metadata install_mt4 apps \ +w_metadata mt4_install apps \ title="MetaTrader 4" \ - year="2020" \ + year="2021" \ media="download" -load_install_mt4() +load_mt4_install() { w_download ${MT_URL:-"https://download.mql5.com/cdn/web/8472/mt4/xmuk4setup.exe"} diff --git a/scripts/verb/install_mt5.verb b/scripts/verb/install_mt5.verb index c3e56d73..7b52b888 100644 --- a/scripts/verb/install_mt5.verb +++ b/scripts/verb/install_mt5.verb @@ -1,11 +1,11 @@ #!/bin/sh -w_metadata install_mt5 apps \ +w_metadata mt5_install apps \ title="MetaTrader 5" \ - year="2020" \ + year="2021" \ media="download" -load_install_mt5() +load_mt5_install() { w_download ${MT_URL:-"https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe"} @@ -21,11 +21,11 @@ load_install_mt5() w_ahk_do " Run, "$(echo *.exe)" SetTitleMatchMode, RegEx - WinWait, MetaTrader 5 Setup + WinWait, MetaTrader 5,, 30 Send, {Enter} WinWait, MetaTrader 5 Setup, Congratulations! Send, {Tab}{Enter} - Process, Wait, terminal64.exe + Process, Wait, terminal64.exe, 30 Process, Close, terminal64.exe " } From 8761ed8e433f80ad2fd67eab6bc2279466fb72f3 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 27 Jan 2024 23:51:04 +0000 Subject: [PATCH 012/101] Installs platform via Ansible --- Dockerfile | 35 +++++++++++++++-------------------- ansible/mt-install.yml | 4 ++++ 2 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 ansible/mt-install.yml diff --git a/Dockerfile b/Dockerfile index f79511b2..592a4002 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base Ubuntu image. -FROM ubuntu:bionic AS ubuntu-base +FROM ubuntu:latest AS ubuntu-base ENV DEBIAN_FRONTEND noninteractive # Setup the default user. @@ -11,25 +11,19 @@ WORKDIR /home/ubuntu FROM ubuntu-base AS ubuntu-provisioned USER root -# Build-time variables. -ARG HTTPS_PROXY -ARG HTTP_PROXY -ARG PROVISION_AHK=0 -ARG PROVISION_CHARLES=0 -ARG PROVISION_MONO=1 -ARG PROVISION_SSH=0 -ARG PROVISION_SUDO=1 -ARG PROVISION_VNC=1 - # Provision container image. +COPY ansible /opt/ansible COPY scripts /opt/scripts ENV PATH $PATH:/opt/scripts:/opt/scripts/py -ENV PROVISION_HASH KwFCBBn659lGNLNiIGd5131XnknI -RUN provision.sh +#ENV PROVISION_HASH KwFCBBn659lGNLNiIGd5131XnknI +#RUN provision.sh -# Clean up. -RUN find /var/lib/apt/lists -type f -delete && \ - find /tmp -mindepth 1 '(' -type d -o -type f ')' -delete +RUN apt update \ + && apt -qqq install ansible git \ + && ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev \ + && ansible-playbook -i "localhost," -c local /opt/ansible/mt-install.yml -v \ + && rm -fr ~/.ansible /tmp/* \ + && find /var/lib/apt/lists -type f -delete # Uses ubuntu as default user. USER ubuntu @@ -52,9 +46,9 @@ VOLUME $BT_DEST FROM ea-tester-base AS ea-tester-with-mt4 # Install platform. -ARG MT_VER=4 -RUN eval.sh install_mt $MT_VER && \ - run_backtest.sh -s PrintPaths -v +RUN ansible-playbook -i "localhost," -c local -e metatrader_version=4 /opt/ansible/mt-install.yml -v \ +#ARG MT_VER=4 +#RUN eval.sh install_mt $MT_VER && run_backtest.sh -s PrintPaths -v # Clean up. RUN eval.sh clean_bt && \ @@ -68,7 +62,8 @@ FROM ea-tester-base AS ea-tester-with-mt5 # Install platform. ARG MT_VER=5 ENV MT_VER $MT_VER -RUN eval.sh install_mt $MT_VER +RUN ansible-playbook -i "localhost," -c local -e metatrader_version=5 /opt/ansible/mt-install.yml -v \ +#RUN eval.sh install_mt $MT_VER #RUN run_backtest.sh -s PrintPaths -v # Clean up. diff --git a/ansible/mt-install.yml b/ansible/mt-install.yml new file mode 100644 index 00000000..95424fef --- /dev/null +++ b/ansible/mt-install.yml @@ -0,0 +1,4 @@ +--- +- hosts: localhost + roles: + - ea31337.metatrader From 62125708f049ef097923782939df0ef106594c63 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 00:06:20 +0000 Subject: [PATCH 013/101] Improves installation steps --- Dockerfile | 24 ++++++++------ scripts/provision.sh | 79 +++++--------------------------------------- 2 files changed, 22 insertions(+), 81 deletions(-) diff --git a/Dockerfile b/Dockerfile index 592a4002..d3adde24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,19 +11,21 @@ WORKDIR /home/ubuntu FROM ubuntu-base AS ubuntu-provisioned USER root +# Build-time variables. +ARG HTTPS_PROXY +ARG HTTP_PROXY +ARG PROVISION_AHK=0 +ARG PROVISION_CHARLES=0 +ARG PROVISION_MONO=0 +ARG PROVISION_SSH=0 +ARG PROVISION_SUDO=1 +ARG PROVISION_VNC=1 + # Provision container image. COPY ansible /opt/ansible COPY scripts /opt/scripts ENV PATH $PATH:/opt/scripts:/opt/scripts/py -#ENV PROVISION_HASH KwFCBBn659lGNLNiIGd5131XnknI -#RUN provision.sh - -RUN apt update \ - && apt -qqq install ansible git \ - && ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev \ - && ansible-playbook -i "localhost," -c local /opt/ansible/mt-install.yml -v \ - && rm -fr ~/.ansible /tmp/* \ - && find /var/lib/apt/lists -type f -delete +RUN provision.sh # Uses ubuntu as default user. USER ubuntu @@ -46,7 +48,7 @@ VOLUME $BT_DEST FROM ea-tester-base AS ea-tester-with-mt4 # Install platform. -RUN ansible-playbook -i "localhost," -c local -e metatrader_version=4 /opt/ansible/mt-install.yml -v \ +#RUN ansible-playbook -i "localhost," -c local -e metatrader_version=4 /opt/ansible/mt-install.yml -v \ #ARG MT_VER=4 #RUN eval.sh install_mt $MT_VER && run_backtest.sh -s PrintPaths -v @@ -62,7 +64,7 @@ FROM ea-tester-base AS ea-tester-with-mt5 # Install platform. ARG MT_VER=5 ENV MT_VER $MT_VER -RUN ansible-playbook -i "localhost," -c local -e metatrader_version=5 /opt/ansible/mt-install.yml -v \ +#RUN ansible-playbook -i "localhost," -c local -e metatrader_version=5 /opt/ansible/mt-install.yml -v \ #RUN eval.sh install_mt $MT_VER #RUN run_backtest.sh -s PrintPaths -v diff --git a/scripts/provision.sh b/scripts/provision.sh index 456d3748..2e3d3227 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -76,6 +76,7 @@ case "$(uname -s)" in echo "Configuring APT..." >&2 apt-config dump | grep -we Recommends -e Suggests | sed s/1/0/ | tee /etc/apt/apt.conf.d/99norecommend apt-config dump | grep -we Recommends -e Suggests + if command -v dpkg-reconfigure > /dev/null; then # Perform an unattended installation of a Debian packages. @@ -103,80 +104,15 @@ case "$(uname -s)" in ) # Install curl and wget if not present. + command -v ansible &> /dev/null || apt-get install -qq ansible command -v curl &> /dev/null || apt-get install -qq curl command -v wget &> /dev/null || apt-get install -qq wget - # CA certificates to allow SSL-based applications to check for the authenticity of SSL connections. - echo "Installing CA certificates and GnuPG..." >&2 - apt-get install -qq ca-certificates gnupg - # Add PPA/Wine repository. - echo "Adding PPA/Wine repository..." >&2 - # Adds GPG release key. - apt-key add < <(curl -S https://dl.winehq.org/wine-builds/winehq.key) - # APT dependencies (for the add-apt-repository). - command -v add-apt-repository || apt-get install -qq software-properties-common - # Adds APT Wine repository. - add-apt-repository -y "deb http://dl.winehq.org/wine-builds/ubuntu/ ${DISTRIB_CODENAME:-bionic} main" - - # Install Charles proxy. - if (("$PROVISION_CHARLES")); then - # Install Charles Root Certificate (if available). - curl -L chls.pro/ssl > /usr/local/share/ca-certificates/charles.crt && update-ca-certificates - # Adds GPG release key. - apt-key add < <(curl -S https://www.charlesproxy.com/packages/apt/PublicKey) - # Adds APT repository. - add-apt-repository -y "deb https://www.charlesproxy.com/packages/apt/ charles-proxy main" - # Install HTTPS transport driver. - apt-get install -qq apt-transport-https - fi - - # Update APT index. - ! (("${NO_APT_UPDATE:-0}")) && ( - echo "Updating APT packages..." >&2 - apt-get -qq update - ) + # Install MT runner. + ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev - # Install necessary packages - echo "Installing APT packages..." >&2 - apt-get install -qq build-essential # Install C, C++ compilers and development (make). - apt-get install -qq dbus # Required for Debian AMI on EC2. - apt-get install -qq fontconfig # Required for fc-match command. - apt-get install -qq language-pack-en # Language pack to prevent an invalid locale. - apt-get install -qq crudini pev # Install CLI tools. - - # Install wine and dependencies. - # @see: https://wiki.winehq.org/Ubuntu - apt-get install -qq winehq-devel # Install Wine. - apt-get install -qq wine-gecko winbind || true # Install Wine recommended libraries. - apt-get install -qq xvfb xdotool x11-utils xterm # Virtual frame buffer and X11 utils. - - # Install Winetricks. - winetricks_url="https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" - curl -sL ${winetricks_url} | install /dev/stdin /usr/local/bin/winetricks - - # Install AHK. - if (("$PROVISION_AHK")); then - echo "Installing AutoHotkey..." >&2 - su - $user -c " - set -x - export DISPLAY=:1.0 - export WINEDLLOVERRIDES=mscoree,mshtml= - echo \$DISPLAY - xdpyinfo &>/dev/null || (! pgrep -a Xvfb && Xvfb \$DISPLAY -screen 0 1024x768x16) & - wineboot -i - wget -qP /tmp -nc 'https://github.com/Lexikos/AutoHotkey_L/releases/download/v1.1.30.01/AutoHotkey_1.1.30.01_setup.exe' && \ - wine64 /tmp/AutoHotkey_*.exe /S /D='C:\\Apps\\AHK' && \ - rm -v /tmp/AutoHotkey_*.exe && \ - (pkill Xvfb || true) - " - ahk_path=$(su - $user -c 'winepath -u "C:\\Apps\\AHK"') - if [ -d "$ahk_path" ]; then - echo "AutoHotkey installed successfully!" >&2 - else - echo "Error: AutoHotkey installation failed!" >&2 - exit 1 - fi - fi + # Install platform. + ansible-playbook -i "localhost," -c local /opt/ansible/mt-install.yml -v # Install Charles proxy. if (("$PROVISION_CHARLES")); then @@ -255,6 +191,9 @@ case "$(uname -s)" in # Erase downloaded archive files. apt-get clean + # Clean up. + find /var/lib/apt/lists -type f -delete \ + && find /tmp -mindepth 1 '(' -type d -o -type f ')' -delete ;; Darwin) brew install git From 3dd73c166be11dbe3c167ce38bb54190b1c86347 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 00:19:21 +0000 Subject: [PATCH 014/101] Uses ubuntu:jammy by default --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d3adde24..4be08ab9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base Ubuntu image. -FROM ubuntu:latest AS ubuntu-base +FROM ubuntu:jammy AS ubuntu-base ENV DEBIAN_FRONTEND noninteractive # Setup the default user. From f19182e6d608763e3decb4743ef36c665a9bd3e3 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 00:22:09 +0000 Subject: [PATCH 015/101] Installs git --- scripts/provision.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index 2e3d3227..3cf77246 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -103,9 +103,10 @@ case "$(uname -s)" in apt-get -qq update ) - # Install curl and wget if not present. + # Install required commands if not present. command -v ansible &> /dev/null || apt-get install -qq ansible command -v curl &> /dev/null || apt-get install -qq curl + command -v git &> /dev/null || apt-get install -qq git command -v wget &> /dev/null || apt-get install -qq wget # Install MT runner. From 609053db11144da6c284ebd7affb999337de1df5 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 01:12:38 +0000 Subject: [PATCH 016/101] Uses rm to clean /tmp --- scripts/provision.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index 3cf77246..b0eb335d 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -193,8 +193,8 @@ case "$(uname -s)" in apt-get clean # Clean up. - find /var/lib/apt/lists -type f -delete \ - && find /tmp -mindepth 1 '(' -type d -o -type f ')' -delete + find /var/lib/apt/lists -type f -delete + rm -fr /tmp/* ;; Darwin) brew install git From 4f8eecb7ccfaea3293206681491cc6ee205f8b9e Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 13:32:00 +0000 Subject: [PATCH 017/101] Renames mt-install.yml to install-mt.yml --- Dockerfile | 4 ++-- ansible/{mt-install.yml => install-mt.yml} | 0 scripts/provision.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename ansible/{mt-install.yml => install-mt.yml} (100%) diff --git a/Dockerfile b/Dockerfile index 4be08ab9..6e1604d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,7 @@ VOLUME $BT_DEST FROM ea-tester-base AS ea-tester-with-mt4 # Install platform. -#RUN ansible-playbook -i "localhost," -c local -e metatrader_version=4 /opt/ansible/mt-install.yml -v \ +#RUN ansible-playbook -i "localhost," -c local -e metatrader_version=4 /opt/ansible/install-mt.yml -v \ #ARG MT_VER=4 #RUN eval.sh install_mt $MT_VER && run_backtest.sh -s PrintPaths -v @@ -64,7 +64,7 @@ FROM ea-tester-base AS ea-tester-with-mt5 # Install platform. ARG MT_VER=5 ENV MT_VER $MT_VER -#RUN ansible-playbook -i "localhost," -c local -e metatrader_version=5 /opt/ansible/mt-install.yml -v \ +#RUN ansible-playbook -i "localhost," -c local -e metatrader_version=5 /opt/ansible/install-mt.yml -v \ #RUN eval.sh install_mt $MT_VER #RUN run_backtest.sh -s PrintPaths -v diff --git a/ansible/mt-install.yml b/ansible/install-mt.yml similarity index 100% rename from ansible/mt-install.yml rename to ansible/install-mt.yml diff --git a/scripts/provision.sh b/scripts/provision.sh index b0eb335d..2a5ca5c4 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -113,7 +113,7 @@ case "$(uname -s)" in ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev # Install platform. - ansible-playbook -i "localhost," -c local /opt/ansible/mt-install.yml -v + ansible-playbook -i "localhost," -c local /opt/ansible/install-mt.yml -v # Install Charles proxy. if (("$PROVISION_CHARLES")); then From ec920c215041255b5b914602d04c6d2ccdd82140 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 13:37:56 +0000 Subject: [PATCH 018/101] Simplifies Dockerfile --- Dockerfile | 59 ++++++++++------------------------------ ansible/install-wine.yml | 4 +++ scripts/provision.sh | 2 +- 3 files changed, 20 insertions(+), 45 deletions(-) create mode 100644 ansible/install-wine.yml diff --git a/Dockerfile b/Dockerfile index 6e1604d0..192b02ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,20 @@ WORKDIR /home/ubuntu FROM ubuntu-base AS ubuntu-provisioned USER root +# Build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="EA-Tester" \ + org.label-schema.description="Headless Forex backtesting for MetaTrader platform" \ + org.label-schema.url="https://github.com/EA31337/EA-Tester" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/EA31337/EA-Tester" \ + org.label-schema.vendor="FX31337" \ + org.label-schema.version=$VERSION \ + org.label-schema.schema-version="1.0" + # Build-time variables. ARG HTTPS_PROXY ARG HTTP_PROXY @@ -44,54 +58,11 @@ RUN mkdir -v -m a=rwx $BT_DEST && \ chown ubuntu:root $BT_DEST VOLUME $BT_DEST -# Install MT4 platform. -FROM ea-tester-base AS ea-tester-with-mt4 - -# Install platform. -#RUN ansible-playbook -i "localhost," -c local -e metatrader_version=4 /opt/ansible/install-mt.yml -v \ -#ARG MT_VER=4 -#RUN eval.sh install_mt $MT_VER && run_backtest.sh -s PrintPaths -v - # Clean up. RUN eval.sh clean_bt && \ eval.sh clean_ea && \ eval.sh clean_files && \ - find /tmp -mindepth 1 -print -delete - -# Install MT5 platform. -FROM ea-tester-base AS ea-tester-with-mt5 - -# Install platform. -ARG MT_VER=5 -ENV MT_VER $MT_VER -#RUN ansible-playbook -i "localhost," -c local -e metatrader_version=5 /opt/ansible/install-mt.yml -v \ -#RUN eval.sh install_mt $MT_VER -#RUN run_backtest.sh -s PrintPaths -v - -# Clean up. -#RUN eval.sh clean_bt -#RUN eval.sh clean_ea -#RUN eval.sh clean_files - -# Final EA Tester image. -FROM ea-tester-with-mt4 as ea-tester - -# Build-time metadata as defined at http://label-schema.org -ARG BUILD_DATE -ARG VCS_REF -ARG VERSION -LABEL org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="EA-Tester" \ - org.label-schema.description="Headless Forex backtesting for MetaTrader platform" \ - org.label-schema.url="https://github.com/EA31337/EA-Tester" \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/EA31337/EA-Tester" \ - org.label-schema.vendor="FX31337" \ - org.label-schema.version=$VERSION \ - org.label-schema.schema-version="1.0" - -# Modify shell startup scripts. -RUN echo source /opt/scripts/.funcs.cmds.inc.sh >> ~/.bashrc + rm -fr /tmp/* # Expose SSH and VNC when installed. EXPOSE 22 5900 diff --git a/ansible/install-wine.yml b/ansible/install-wine.yml new file mode 100644 index 00000000..171df691 --- /dev/null +++ b/ansible/install-wine.yml @@ -0,0 +1,4 @@ +--- +- hosts: localhost + roles: + - ea31337.wine diff --git a/scripts/provision.sh b/scripts/provision.sh index 2a5ca5c4..57c65b80 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -113,7 +113,7 @@ case "$(uname -s)" in ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev # Install platform. - ansible-playbook -i "localhost," -c local /opt/ansible/install-mt.yml -v + ansible-playbook -i "localhost," -c local /opt/ansible/install-wine.yml -v # Install Charles proxy. if (("$PROVISION_CHARLES")); then From b78787a7172f0a5c86843adf741f0a128567bc7d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 13:48:07 +0000 Subject: [PATCH 019/101] Improves install scripts by using verb files --- scripts/install_mt4.sh | 18 +++++++++++++++--- scripts/install_mt5.sh | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index 6b76427b..7eb434f1 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -2,7 +2,10 @@ # Script to install MT4 platform using winetricks. [ -n "$OPT_NOERR" ] || set -e [ -n "$OPT_TRACE" ] && set -x -CWD="$( (cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" 2> /dev/null && pwd -P) || pwd -P)" +CWD="$( + cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" 2> /dev/null + pwd -P +)" type winetricks > /dev/null # Load variables. @@ -32,7 +35,16 @@ echo "Installing .NET..." >&2 winetricks -q dotnet472 echo "Installing platform..." >&2 -winetricks -q -v mt4 +#winetricks -q -v mt4 +winetricks -q "$CWD"/verb/install_mt4.verb + +. "$CWD"/.vars.inc.sh +if [ -n "$TERMINAL5_DIR" ]; then + echo "Terminal path: $TERMINAL5_DIR" >&2 + echo "Installation successful." >&2 +else + echo "Installation failed!" >&2 + exit 1 +fi -echo "Installation successful." >&2 echo "${BASH_SOURCE[0]} done." >&2 diff --git a/scripts/install_mt5.sh b/scripts/install_mt5.sh index d3da8277..4a9e946d 100755 --- a/scripts/install_mt5.sh +++ b/scripts/install_mt5.sh @@ -45,4 +45,5 @@ else echo "Installation failed!" >&2 exit 1 fi + echo "${BASH_SOURCE[0]} done." >&2 From fd118c2326be375a077fbf783cd4367f774207e1 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 13:56:17 +0000 Subject: [PATCH 020/101] Removes clean ups from Dockerfile --- Dockerfile | 6 ------ scripts/provision.sh | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 192b02ba..92ab62a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,12 +58,6 @@ RUN mkdir -v -m a=rwx $BT_DEST && \ chown ubuntu:root $BT_DEST VOLUME $BT_DEST -# Clean up. -RUN eval.sh clean_bt && \ - eval.sh clean_ea && \ - eval.sh clean_files && \ - rm -fr /tmp/* - # Expose SSH and VNC when installed. EXPOSE 22 5900 diff --git a/scripts/provision.sh b/scripts/provision.sh index 57c65b80..bc87480d 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -194,7 +194,7 @@ case "$(uname -s)" in # Clean up. find /var/lib/apt/lists -type f -delete - rm -fr /tmp/* + #find /tmp -exec rm -rf {} + ;; Darwin) brew install git From 818e285172257e19e73eeabdd7a716a6063865c8 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 14:07:24 +0000 Subject: [PATCH 021/101] install-wine: Adds wine_install_winetricks --- ansible/install-wine.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/install-wine.yml b/ansible/install-wine.yml index 171df691..e63b006d 100644 --- a/ansible/install-wine.yml +++ b/ansible/install-wine.yml @@ -1,4 +1,6 @@ --- - hosts: localhost roles: - - ea31337.wine + - name: ea31337.wine + vars: + wine_install_winetricks: true From 50dc20498ae57a0eecda79dfb3c44a719b2a682b Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 14:09:55 +0000 Subject: [PATCH 022/101] Installs Xvfb --- ansible/install-xvfb.yml | 4 ++++ scripts/provision.sh | 1 + 2 files changed, 5 insertions(+) create mode 100644 ansible/install-xvfb.yml diff --git a/ansible/install-xvfb.yml b/ansible/install-xvfb.yml new file mode 100644 index 00000000..cb13c707 --- /dev/null +++ b/ansible/install-xvfb.yml @@ -0,0 +1,4 @@ +--- +- hosts: localhost + roles: + - name: ea31337.xvfb diff --git a/scripts/provision.sh b/scripts/provision.sh index bc87480d..9c905b5a 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -114,6 +114,7 @@ case "$(uname -s)" in # Install platform. ansible-playbook -i "localhost," -c local /opt/ansible/install-wine.yml -v + ansible-playbook -i "localhost," -c local /opt/ansible/install-xvfb.yml -v # Install Charles proxy. if (("$PROVISION_CHARLES")); then From 29745b53f9751a36c8bb6f23844bb35e0f813e79 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 15:09:34 +0000 Subject: [PATCH 023/101] Removes redundant targets --- .github/workflows/docker.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 030b6fde..1dc9d386 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -40,18 +40,12 @@ jobs: 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 }}" From fa70506e3fc7eefccda578b43cd439fdcd57db07 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 28 Jan 2024 15:18:27 +0000 Subject: [PATCH 024/101] Installs winetricks from master --- ansible/install-wine.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/install-wine.yml b/ansible/install-wine.yml index e63b006d..edf73ee9 100644 --- a/ansible/install-wine.yml +++ b/ansible/install-wine.yml @@ -4,3 +4,5 @@ - name: ea31337.wine vars: wine_install_winetricks: true + wine_winetricks_url: >- + https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks From 40e3e3152b807455ac83651de7d1bf528af5dad0 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 5 Feb 2024 01:25:27 +0000 Subject: [PATCH 025/101] Adds galaxy-requirements.yml --- ansible/galaxy-requirements.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 ansible/galaxy-requirements.yml diff --git a/ansible/galaxy-requirements.yml b/ansible/galaxy-requirements.yml new file mode 100644 index 00000000..aeed7678 --- /dev/null +++ b/ansible/galaxy-requirements.yml @@ -0,0 +1,9 @@ +# A file containing a list of collections to be installed. +# Usage: +# ansible-galaxy install -r requirements.yml +--- +roles: + - name: ea31337.metatrader + scm: git + src: https://github.com/EA31337/ansible-role-metatrader.git + version: dev From 1b33fd0c9b5d334bcddb5dcaf66f0f27bcace516 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 5 Feb 2024 01:27:37 +0000 Subject: [PATCH 026/101] GHA: Installs platform via Ansible --- .github/workflows/compile.yml | 17 +++++++++++++---- ansible/install-mt.yml | 4 ---- ansible/install-wine.yml | 8 -------- ansible/install-xvfb.yml | 4 ---- ansible/platform-install.yml | 3 +++ 5 files changed, 16 insertions(+), 20 deletions(-) delete mode 100644 ansible/install-mt.yml delete mode 100644 ansible/install-wine.yml delete mode 100644 ansible/install-xvfb.yml create mode 100644 ansible/platform-install.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index da7a2299..54e6bda3 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -10,7 +10,6 @@ on: push: branches: - 'master' - - 'ci' - '*dev*' paths: - '**/*.mq?' @@ -18,9 +17,19 @@ on: jobs: Compile: - runs-on: windows-latest + 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: platform-install.yml + directory: ./ansible + options: | + --connection local + --inventory localhost, + --verbose + requirements: galaxy-requirements.yml + - uses: fx31337/mql-compile-action@dev with: verbose: true diff --git a/ansible/install-mt.yml b/ansible/install-mt.yml deleted file mode 100644 index 95424fef..00000000 --- a/ansible/install-mt.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- hosts: localhost - roles: - - ea31337.metatrader diff --git a/ansible/install-wine.yml b/ansible/install-wine.yml deleted file mode 100644 index edf73ee9..00000000 --- a/ansible/install-wine.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: localhost - roles: - - name: ea31337.wine - vars: - wine_install_winetricks: true - wine_winetricks_url: >- - https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks diff --git a/ansible/install-xvfb.yml b/ansible/install-xvfb.yml deleted file mode 100644 index cb13c707..00000000 --- a/ansible/install-xvfb.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- hosts: localhost - roles: - - name: ea31337.xvfb diff --git a/ansible/platform-install.yml b/ansible/platform-install.yml new file mode 100644 index 00000000..6ce6fa60 --- /dev/null +++ b/ansible/platform-install.yml @@ -0,0 +1,3 @@ +--- +- hosts: all + roles: [ea31337.metatrader] From 925a7c150a182c33b4d26c7200574d3752c97bb3 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 5 Feb 2024 01:42:37 +0000 Subject: [PATCH 027/101] GHA: Compile: Sets mt-path --- .github/workflows/compile.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 54e6bda3..9da72d46 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -17,6 +17,8 @@ on: jobs: Compile: + env: + GITHUB_HOME: ${{ github.workspace }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -32,4 +34,5 @@ jobs: requirements: galaxy-requirements.yml - uses: fx31337/mql-compile-action@dev with: + mt-path: ~/.wine/drive_c verbose: true From a1309b78dae6957148251fccd1a8b3e93aab9080 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 5 Feb 2024 01:45:35 +0000 Subject: [PATCH 028/101] Re-adds missing playbooks --- .github/workflows/compile.yml | 2 +- ansible/{platform-install.yml => install-platform.yml} | 0 ansible/install-wine.yml | 3 +++ ansible/install-xvfb.yml | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) rename ansible/{platform-install.yml => install-platform.yml} (100%) create mode 100644 ansible/install-wine.yml create mode 100644 ansible/install-xvfb.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 9da72d46..483e0811 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -25,7 +25,7 @@ jobs: - name: Installs platform uses: dawidd6/action-ansible-playbook@v2 with: - playbook: platform-install.yml + playbook: install-platform.yml directory: ./ansible options: | --connection local diff --git a/ansible/platform-install.yml b/ansible/install-platform.yml similarity index 100% rename from ansible/platform-install.yml rename to ansible/install-platform.yml diff --git a/ansible/install-wine.yml b/ansible/install-wine.yml new file mode 100644 index 00000000..e2b238b3 --- /dev/null +++ b/ansible/install-wine.yml @@ -0,0 +1,3 @@ +--- +- hosts: all + roles: [ea31337.wine] diff --git a/ansible/install-xvfb.yml b/ansible/install-xvfb.yml new file mode 100644 index 00000000..7647ca63 --- /dev/null +++ b/ansible/install-xvfb.yml @@ -0,0 +1,3 @@ +--- +- hosts: all + roles: [ea31337.xvfb] From 4deb8e0ccb1ba71ceece664a7028a1289927a4bd Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 5 Feb 2024 01:47:09 +0000 Subject: [PATCH 029/101] GHA: Testing mt-path with env.GITHUB_HOME --- .github/workflows/compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 483e0811..a1fd68d6 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -34,5 +34,5 @@ jobs: requirements: galaxy-requirements.yml - uses: fx31337/mql-compile-action@dev with: - mt-path: ~/.wine/drive_c + mt-path: ${{ env.GITHUB_HOME }} verbose: true From c950ecf77d9d1bf341171bfe66dec667f8ef142f Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 5 Feb 2024 01:51:41 +0000 Subject: [PATCH 030/101] GHA: Compile: Updates mt-path --- .github/workflows/compile.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index a1fd68d6..2a91da2e 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -17,8 +17,6 @@ on: jobs: Compile: - env: - GITHUB_HOME: ${{ github.workspace }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -34,5 +32,5 @@ jobs: requirements: galaxy-requirements.yml - uses: fx31337/mql-compile-action@dev with: - mt-path: ${{ env.GITHUB_HOME }} + mt-path: ${{ github.workspace }}/../../../.wine/drive_c verbose: true From 2fddd5fe58aed36820ab633565b20aa978691a77 Mon Sep 17 00:00:00 2001 From: kenorb Date: Wed, 7 Feb 2024 01:51:04 +0000 Subject: [PATCH 031/101] Installs ansible via pip --- scripts/provision.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index 9c905b5a..607f96d0 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -104,10 +104,11 @@ case "$(uname -s)" in ) # Install required commands if not present. - command -v ansible &> /dev/null || apt-get install -qq ansible command -v curl &> /dev/null || apt-get install -qq curl command -v git &> /dev/null || apt-get install -qq git + command -v pip &> /dev/null || apt-get install -qq pip command -v wget &> /dev/null || apt-get install -qq wget + command -v ansible &> /dev/null || pip install ansible # Install MT runner. ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev From 6a43cefb1d948e14361cff9c3f9ec0f27d30656c Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 01:33:14 +0000 Subject: [PATCH 032/101] Removes install_mt4x.sh as redundant --- scripts/install_mt4x.sh | 59 ----------------------------------------- 1 file changed, 59 deletions(-) delete mode 100755 scripts/install_mt4x.sh diff --git a/scripts/install_mt4x.sh b/scripts/install_mt4x.sh deleted file mode 100755 index ff2516c3..00000000 --- a/scripts/install_mt4x.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash -# Script to install MT platform using xdotool. -[ -n "$OPT_NOERR" ] || set -e -[ -n "$OPT_TRACE" ] && set -x -CWD="$( (cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" 2> /dev/null && pwd -P) || pwd -P)" -EXEFILE=mt4setup.exe - -# Check the dependencies. -type winetricks wget xdotool xwininfo wine ar > /dev/null - -# Load the shell functions. -. "$CWD/.funcs.inc.sh" -. "$CWD/.funcs.cmds.inc.sh" - -echo "Installing winhttp..." >&2 -winetricks -q winhttp - -echo "Downloading MT4 installer..." >&2 -[ ! -f "$HOME/$EXEFILE" ] \ - && wget -O "$HOME/$EXEFILE" -ct3 --content-disposition "${MT_URL:-"https://download.mql5.com/cdn/web/8472/mt4/xmuk4setup.exe"}" -[ -f "$HOME/$EXEFILE" ] - -# Prints information of the window status in the background. -echo "Checking display..." >&2 -set_display -live_stats & - -echo "Starting MT4 Setup in Wine..." >&2 -[ -f /.dockerenv ] && export WINEPREFIX="$HOME/.wine_mt4" # Fixes MT4 startup issue in Docker. -wine "$HOME/$EXEFILE" & - -echo "Waiting for installer to initialize..." >&2 -while ! WID=$(xdotool getactivewindow 2> /dev/null); do sleep 2; done - -echo "Installing $(xdotool getwindowname "$WID")..." >&2 -while WID=$(xdotool getactivewindow); do - xdotool key --window "$WID" --delay 500 Alt+N - sleep 20 - xdotool key --window "$WID" --delay 500 Tab space -done - -# Workaround for Chrome launching when installer finishes. -pkill -KILL chrome || true -#(sleep 10 && wineserver -k) & - -echo "Waiting for platform to start..." >&2 -while ! WID=$(xdotool getactivewindow 2> /dev/null); do sleep 5; done -xwininfo -id "$WID" -tree - -# Close running MT4 instance, first the two login popup window, secondly application itself. -echo "Closing platform..." >&2 -xdotool search -classname terminal.exe key --delay 200 Escape Escape Alt+f x - -echo "Waiting for application to exit..." >&2 -while WID=$(xdotool getactivewindow 2> /dev/null); do sleep 2; done - -find "$HOME" /opt -name terminal.exe -print -quit -echo "Installation successful." >&2 -echo "${BASH_SOURCE[0]} done." >&2 From d50ce2c777263bd93261ac4c9d5c91972cdadf1f Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 01:33:48 +0000 Subject: [PATCH 033/101] Improves platform installation scripts --- scripts/.funcs.cmds.inc.sh | 35 +++-------------------------------- scripts/install_mt4.sh | 19 +++---------------- scripts/install_mt5.sh | 18 +++--------------- scripts/options.txt | 2 +- scripts/provision.sh | 2 +- scripts/run_backtest.sh | 4 ++-- 6 files changed, 13 insertions(+), 67 deletions(-) diff --git a/scripts/.funcs.cmds.inc.sh b/scripts/.funcs.cmds.inc.sh index 52c00f10..5c9ffd18 100644 --- a/scripts/.funcs.cmds.inc.sh +++ b/scripts/.funcs.cmds.inc.sh @@ -210,10 +210,10 @@ filever() } # Install platform. -# Usage: install_mt [ver/4/5/v4.0.0.1260/v5.0.0.2361] (dest) +# Usage: install_mt [ver/4/5] (dest) install_mt() { - type jq wget unzip > /dev/null + type jq wget > /dev/null local mt_ver=${1:-$MT_VER} local dir_dest=${2:-$WINE_PATH} dir_dest=${dir_dest:-$HOME} @@ -222,43 +222,14 @@ install_mt() 4) . "$CWD"/install_mt4.sh ;; - 4x) - . "$CWD"/install_mt4x.sh - ;; 5) . "$CWD"/install_mt5.sh ;; - 4.0.0.* | 5.0.0.*) - [ ! -d "$dir_dest" ] && mkdir $VFLAG -p "$dir_dest" - [ ! -w "$dir_dest" ] && { - echo "ERROR: Destination folder not writable!" - (id && stat "$dir_dest") >&2 - exit 1 - } - cd "$dir_dest" - header=$([ -n "${GITHUB_API_TOKEN}" ] && echo "Authorization: Bearer ${GITHUB_API_TOKEN}" || echo "") - mt_releases_json="$(curl -H "Content-Type: application/json; $header" -s https://api.github.com/repos/${REPO_MT-"EA31337/MT-Platforms"}/releases)" - jq ".[]" <<< "$mt_releases_json" > /dev/null || true # Test JSON syntax. - mapfile -t mt_releases_list < <(jq -r '.[]["tag_name"]' <<< "$mt_releases_json") - if [[ " ${mt_releases_list[*]} " =~ ${mt_ver} ]]; then - mt_release_url=$(jq -r '.[]|select(.tag_name == "'${mt_ver}'")["assets"][0]["browser_download_url"]' <<< "$mt_releases_json") - wget -nv -c "$mt_release_url" - (unzip -ou "mt-$mt_ver.zip" && rm $VFLAG "mt-$mt_ver.zip") 1>&2 - clean_bt . '*' - else - echo "Error: Cannot find supported platform version. Supported: ${mt_releases_list[@]}" >&2 - if [ -z "${mt_releases_list[*]}" ]; then - echo "Error: Empty release list!" - echo $mt_releases_json - fi - fi - cd - &> /dev/null - ;; *) if [ -z "$MT_VER" ]; then echo "Error: Platform not specified!" >&2 else - echo "Error: Not supported platform version ($MT_VER). Supported: 4, 4x, 4.0.0.x, 5 or 5.0.0.x." >&2 + echo "Error: Not supported platform version ($MT_VER). Supported: 4, 5." >&2 fi exit 1 ;; diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index 7eb434f1..e2b75680 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -6,6 +6,7 @@ CWD="$( cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" 2> /dev/null pwd -P )" +type ansible > /dev/null type winetricks > /dev/null # Load variables. @@ -20,23 +21,9 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.inc.sh" . "$CWD/.funcs.cmds.inc.sh" -# Activates display. -echo "Configuring display..." >&2 -set_display - -# Updates Wine configuration. -echo "Updating configuration..." >&2 -wineboot -u - -echo "Installing winhttp..." >&2 -winetricks -q winhttp - -echo "Installing .NET..." >&2 -winetricks -q dotnet472 - echo "Installing platform..." >&2 -#winetricks -q -v mt4 -winetricks -q "$CWD"/verb/install_mt4.verb +ansible-playbook -c local -e metatrader_version=4 +\ -i "localhost," /opt/ansible/install-platform.yml -v . "$CWD"/.vars.inc.sh if [ -n "$TERMINAL5_DIR" ]; then diff --git a/scripts/install_mt5.sh b/scripts/install_mt5.sh index 4a9e946d..ddef05a8 100755 --- a/scripts/install_mt5.sh +++ b/scripts/install_mt5.sh @@ -6,6 +6,7 @@ CWD="$( cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" 2> /dev/null pwd -P )" +type ansible > /dev/null type winetricks > /dev/null # Load variables. @@ -20,22 +21,9 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.inc.sh" . "$CWD/.funcs.cmds.inc.sh" -# Activates display. -echo "Configuring display..." >&2 -set_display - -# Updates Wine configuration. -echo "Updating configuration..." >&2 -wineboot -u - -echo "Installing winhttp..." >&2 -winetricks -q winhttp - -echo "Installing .NET..." >&2 -winetricks -q dotnet472 - echo "Installing platform..." >&2 -winetricks -q "$CWD"/verb/install_mt5.verb +ansible-playbook -c local -e metatrader_version=5 +\ -i "localhost," /opt/ansible/install-platform.yml -v . "$CWD"/.vars.inc.sh if [ -n "$TERMINAL5_DIR" ]; then diff --git a/scripts/options.txt b/scripts/options.txt index 863f6b9f..f7ad9958 100644 --- a/scripts/options.txt +++ b/scripts/options.txt @@ -60,7 +60,7 @@ Supported options: Specifies range of months in each year to test. Default: 1-12. Variable (uint/string): BT_MONTHS -M (version) - Specifies version of MetaTrader to use for the test (e.g. 4, 4x, 5, 4.0.0.1010). Default: 4.0.0.1010 + Specifies version of MetaTrader to use for the test (e.g. 4, 5). Default: 4 Variable (string): MT_VER -o Runs test in optimization mode. diff --git a/scripts/provision.sh b/scripts/provision.sh index 607f96d0..ed71d253 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -154,7 +154,7 @@ case "$(uname -s)" in # Install other CLI tools. apt-get install -qq less binutils coreutils moreutils # Common CLI utils. - apt-get install -qq cabextract zip unzip p7zip-full # Compression tools. + apt-get install -qq cabextract zip p7zip-full # Compression tools. apt-get install -qq git links tree pv bc # Required commands. apt-get install -qq realpath || true # Install realpath if available. apt-get install -qq html2text jq # Required parsers. diff --git a/scripts/run_backtest.sh b/scripts/run_backtest.sh index 1494c66c..f049c0d8 100755 --- a/scripts/run_backtest.sh +++ b/scripts/run_backtest.sh @@ -219,8 +219,8 @@ while getopts $ARGS arg; do MT_VER=5 ;; - M) # Specify version of MetaTrader (e.g. 4, 4x, 5, 4.0.0.1010). - MT_VER=${OPTARG:-4.0.0.1010} + M) # Specify version of MetaTrader (e.g. 4, 5). + MT_VER=${OPTARG:-4} ;; v) # Verbose mode. From 5747dbb31a5ec3eea233df1fa0b2f6d2e8165c58 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 01:54:41 +0000 Subject: [PATCH 034/101] Installs winetricks via ansible --- scripts/install_mt4.sh | 6 ++++-- scripts/install_mt5.sh | 6 ++++-- scripts/provision.sh | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index e2b75680..7bf15798 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -7,6 +7,7 @@ CWD="$( pwd -P )" type ansible > /dev/null +type ansible-galaxy > /dev/null type winetricks > /dev/null # Load variables. @@ -22,8 +23,9 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.cmds.inc.sh" echo "Installing platform..." >&2 -ansible-playbook -c local -e metatrader_version=4 -\ -i "localhost," /opt/ansible/install-platform.yml -v +ansible-galaxy install git+https://github.com/EA31337/ansible-role-metatrader.git,dev +ansible-playbook -c local -e metatrader_version=4 -e wine_install_winetricks=1 \ + -i "localhost," /opt/ansible/install-platform.yml -v . "$CWD"/.vars.inc.sh if [ -n "$TERMINAL5_DIR" ]; then diff --git a/scripts/install_mt5.sh b/scripts/install_mt5.sh index ddef05a8..a82c4053 100755 --- a/scripts/install_mt5.sh +++ b/scripts/install_mt5.sh @@ -7,6 +7,7 @@ CWD="$( pwd -P )" type ansible > /dev/null +type ansible-galaxy > /dev/null type winetricks > /dev/null # Load variables. @@ -22,8 +23,9 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.cmds.inc.sh" echo "Installing platform..." >&2 -ansible-playbook -c local -e metatrader_version=5 -\ -i "localhost," /opt/ansible/install-platform.yml -v +ansible-galaxy install git+https://github.com/EA31337/ansible-role-metatrader.git,dev +ansible-playbook -c local -e metatrader_version=5 -e wine_install_winetricks=1 \ + -i "localhost," /opt/ansible/install-platform.yml -v . "$CWD"/.vars.inc.sh if [ -n "$TERMINAL5_DIR" ]; then diff --git a/scripts/provision.sh b/scripts/provision.sh index ed71d253..bb1487fc 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -114,7 +114,8 @@ case "$(uname -s)" in ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev # Install platform. - ansible-playbook -i "localhost," -c local /opt/ansible/install-wine.yml -v + ansible-playbook -i "localhost," -c local /opt/ansible/install-wine.yml -v \ + -e wine_install_winetricks=1 ansible-playbook -i "localhost," -c local /opt/ansible/install-xvfb.yml -v # Install Charles proxy. From 30385a227d17088707f12044c92921a97602f032 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 14:52:07 +0000 Subject: [PATCH 035/101] Improves ansible-galaxy to install requirements --- scripts/install_mt4.sh | 2 +- scripts/install_mt5.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index 7bf15798..84dcfafe 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -23,7 +23,7 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.cmds.inc.sh" echo "Installing platform..." >&2 -ansible-galaxy install git+https://github.com/EA31337/ansible-role-metatrader.git,dev +ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml ansible-playbook -c local -e metatrader_version=4 -e wine_install_winetricks=1 \ -i "localhost," /opt/ansible/install-platform.yml -v diff --git a/scripts/install_mt5.sh b/scripts/install_mt5.sh index a82c4053..70439609 100755 --- a/scripts/install_mt5.sh +++ b/scripts/install_mt5.sh @@ -23,7 +23,7 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.cmds.inc.sh" echo "Installing platform..." >&2 -ansible-galaxy install git+https://github.com/EA31337/ansible-role-metatrader.git,dev +ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml ansible-playbook -c local -e metatrader_version=5 -e wine_install_winetricks=1 \ -i "localhost," /opt/ansible/install-platform.yml -v From e47a7a00b0e98fe53a956811d5dc6a47ec5e5481 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 14:59:03 +0000 Subject: [PATCH 036/101] Improves ansible-galaxy requirements logic --- ansible/galaxy-requirements.yml | 4 ++-- scripts/install_mt4.sh | 1 - scripts/install_mt5.sh | 1 - scripts/provision.sh | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ansible/galaxy-requirements.yml b/ansible/galaxy-requirements.yml index aeed7678..92351295 100644 --- a/ansible/galaxy-requirements.yml +++ b/ansible/galaxy-requirements.yml @@ -3,7 +3,7 @@ # ansible-galaxy install -r requirements.yml --- roles: - - name: ea31337.metatrader + - name: ea31337.mt_runner scm: git - src: https://github.com/EA31337/ansible-role-metatrader.git + src: https://github.com/EA31337/ansible-role-mt-runner.git version: dev diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index 84dcfafe..d2d08b19 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -23,7 +23,6 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.cmds.inc.sh" echo "Installing platform..." >&2 -ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml ansible-playbook -c local -e metatrader_version=4 -e wine_install_winetricks=1 \ -i "localhost," /opt/ansible/install-platform.yml -v diff --git a/scripts/install_mt5.sh b/scripts/install_mt5.sh index 70439609..0aa35936 100755 --- a/scripts/install_mt5.sh +++ b/scripts/install_mt5.sh @@ -23,7 +23,6 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.cmds.inc.sh" echo "Installing platform..." >&2 -ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml ansible-playbook -c local -e metatrader_version=5 -e wine_install_winetricks=1 \ -i "localhost," /opt/ansible/install-platform.yml -v diff --git a/scripts/provision.sh b/scripts/provision.sh index bb1487fc..c6aae7e9 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -110,8 +110,8 @@ case "$(uname -s)" in command -v wget &> /dev/null || apt-get install -qq wget command -v ansible &> /dev/null || pip install ansible - # Install MT runner. - ansible-galaxy install git+https://github.com/EA31337/ansible-role-mt-runner.git,dev + # Install Ansible Galaxy requirements. + ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml # Install platform. ansible-playbook -i "localhost," -c local /opt/ansible/install-wine.yml -v \ From abd92d2eac04618e04c8dde41e7d243d07f3b458 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 15:13:11 +0000 Subject: [PATCH 037/101] Installs Ansible Galaxy requirements in install scripts as well --- scripts/install_mt4.sh | 4 ++++ scripts/install_mt5.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index d2d08b19..f22fa6e9 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -22,6 +22,10 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.inc.sh" . "$CWD/.funcs.cmds.inc.sh" +# Install Ansible Galaxy requirements. +ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml + +# Install platform. echo "Installing platform..." >&2 ansible-playbook -c local -e metatrader_version=4 -e wine_install_winetricks=1 \ -i "localhost," /opt/ansible/install-platform.yml -v diff --git a/scripts/install_mt5.sh b/scripts/install_mt5.sh index 0aa35936..cf601aea 100755 --- a/scripts/install_mt5.sh +++ b/scripts/install_mt5.sh @@ -22,6 +22,10 @@ curl -s ifconfig.me/all.json . "$CWD/.funcs.inc.sh" . "$CWD/.funcs.cmds.inc.sh" +# Install Ansible Galaxy requirements. +ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml + +# Install platform. echo "Installing platform..." >&2 ansible-playbook -c local -e metatrader_version=5 -e wine_install_winetricks=1 \ -i "localhost," /opt/ansible/install-platform.yml -v From c3327a5f4e3ddf96bfb9045509c3d7ff6e9a3f30 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 15:41:11 +0000 Subject: [PATCH 038/101] GHA: tests-shell: Adds volumes to container --- .github/workflows/tests-shell.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 6ea402f8..5ef4800c 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -24,6 +24,8 @@ jobs: OPT_TRACE: ${{ runner.debug }} OPT_VERBOSE: true image: ea31337/ea-tester:dev + volumes: + - ${{ github.workspace }}/scripts/tests:/opt/scripts strategy: matrix: test: From 5d05a47e8cdcf161973e6fb1aef9bf29f78a4bd5 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 15:52:54 +0000 Subject: [PATCH 039/101] GHA: tests-shell: Adds options: --user root Refs: https://github.com/actions/checkout/issues/956 --- .github/workflows/tests-shell.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 5ef4800c..bc9ad069 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -24,6 +24,7 @@ jobs: OPT_TRACE: ${{ runner.debug }} OPT_VERBOSE: true image: ea31337/ea-tester:dev + options: --user root volumes: - ${{ github.workspace }}/scripts/tests:/opt/scripts strategy: From ff704426e895600b7687216333a06b4dbd08b1a5 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 16:11:40 +0000 Subject: [PATCH 040/101] GHA: tests-shell: Adds GIT_CEILING_DIRECTORIES Refs: https://github.com/actions/checkout/issues/760 --- .github/workflows/tests-shell.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index bc9ad069..8f83b42d 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -39,4 +39,6 @@ jobs: - ./test_vars.sh steps: - uses: actions/checkout@v3 + env: + GIT_CEILING_DIRECTORIES: /__w - run: ${{ matrix.test }} From e5ff3cdf2180d0a5e9b2da49142abbd649718245 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 16:21:19 +0000 Subject: [PATCH 041/101] Adds: git config --global --add safe.directory /__w Refs: https://github.com/actions/checkout/issues/760 Upgrades actions/checkout to v4 --- .github/workflows/tests-shell.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 8f83b42d..fc1f358b 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -38,7 +38,11 @@ jobs: - ./test_eval.sh - ./test_vars.sh steps: - - uses: actions/checkout@v3 + - name: Adds safe directory + # Refs: https://github.com/actions/checkout/issues/760 + run: git config --global --add safe.directory /__w + - uses: actions/checkout@v4 env: + # Refs: https://github.com/actions/checkout/issues/956 GIT_CEILING_DIRECTORIES: /__w - run: ${{ matrix.test }} From c6733239828d98b55c82fcce55f39113b9e3c6d3 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 16:41:00 +0000 Subject: [PATCH 042/101] GHA: test_backtest: Prints errors with tail --- scripts/tests/test_backtest.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/tests/test_backtest.sh b/scripts/tests/test_backtest.sh index 73a426ff..ba20a646 100755 --- a/scripts/tests/test_backtest.sh +++ b/scripts/tests/test_backtest.sh @@ -24,6 +24,7 @@ export RUN_ON_ERROR="tail $file_stdout $file_stderr" ## START TESTS # Installs both platforms. +tail -f "${file_stderr}" & install_mt 4 /opt 1> $file_stdout 2> $file_stderr install_mt 5 /opt 1> $file_stdout 2> $file_stderr @@ -41,4 +42,5 @@ run_backtest -_ -e Dummy 1> $file_stdout 2> $file_stderr grep "compiled: 1" $file_stdout ! grep ^ERROR $file_stderr +kill_jobs echo "${BASH_SOURCE[0]} done." From 45f676575f456733f64651ce9536c889bebdff2a Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 16:43:52 +0000 Subject: [PATCH 043/101] GHA: Sets WINEPREFIX to /tmp Refs: https://stackoverflow.com/q/16818101/55075 --- .github/workflows/tests-shell.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index fc1f358b..2d9d06e1 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -46,3 +46,6 @@ jobs: # Refs: https://github.com/actions/checkout/issues/956 GIT_CEILING_DIRECTORIES: /__w - run: ${{ matrix.test }} + env: + # Refs: https://stackoverflow.com/q/16818101/55075 + WINEPREFIX: /tmp/.wine From 4df2c1c0a81e43ddd0a48fffff3c94e03f1387c0 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 17:05:25 +0000 Subject: [PATCH 044/101] GHA: tests-shell: Adds env.PATH --- .github/workflows/tests-shell.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 2d9d06e1..3c372097 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -47,5 +47,6 @@ jobs: GIT_CEILING_DIRECTORIES: /__w - run: ${{ matrix.test }} env: + 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 From bdab459a6df3ec7868ee84c01d77f629cce27a0f Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 17:23:39 +0000 Subject: [PATCH 045/101] Renames WINE_PATH to WINEPREFIX --- scripts/.funcs.cmds.inc.sh | 2 +- scripts/.vars.inc.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/.funcs.cmds.inc.sh b/scripts/.funcs.cmds.inc.sh index 5c9ffd18..f393db3a 100644 --- a/scripts/.funcs.cmds.inc.sh +++ b/scripts/.funcs.cmds.inc.sh @@ -215,7 +215,7 @@ install_mt() { type jq wget > /dev/null local mt_ver=${1:-$MT_VER} - local dir_dest=${2:-$WINE_PATH} + local dir_dest=${2:-$WINEPREFIX/drive_c} dir_dest=${dir_dest:-$HOME} set_display case $mt_ver in diff --git a/scripts/.vars.inc.sh b/scripts/.vars.inc.sh index 15cd3605..8fa95c48 100644 --- a/scripts/.vars.inc.sh +++ b/scripts/.vars.inc.sh @@ -10,7 +10,7 @@ get_scan_dirs() printf "%s %s %s %s %s" "$ROOT" \ $([ -d "$OPT" ] && printf "%s " "$OPT") \ $([ -w "$HOME" ] && printf "%s " "$HOME") \ - $([ -w "$WINE_PATH" ] && printf "%s " "$WINE_PATH") \ + $([ -w "$WINEPREFIX" ] && printf "%s " "$WINEPREFIX") \ $([ -w "$WORKDIR" ] && printf "%s " "$WORKDIR") } # Determine VM. @@ -30,8 +30,8 @@ is_vm() # Determine platform paths. SCR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" 2> /dev/null && pwd -P || pwd -P)" ROOT="$(cd "$SCR" && git rev-parse --show-toplevel 2> /dev/null || echo "$SCR/..")" +WINEPREFIX="${WINEPREFIX:-$HOME/.wine}" WORKDIR="${WORKDIR:-$ROOT}" -WINE_PATH="${WINE_PATH:-$HOME/.wine/drive_c}" OPT="/opt" CONF_TEST="mt$(get_mtv)-tester.ini" CONF_TERM="terminal.ini" From 2c9c973a9e159c93ba7a62431eacf62e7664e5c5 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 17:25:24 +0000 Subject: [PATCH 046/101] GHA: Improves environmental variables --- .github/workflows/tests-shell.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 3c372097..ea69a86a 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -23,6 +23,9 @@ 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 volumes: @@ -46,7 +49,3 @@ jobs: # Refs: https://github.com/actions/checkout/issues/956 GIT_CEILING_DIRECTORIES: /__w - run: ${{ matrix.test }} - env: - 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 From 5667c63731751c6136b42d6e1518c632bfac176d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 17:34:02 +0000 Subject: [PATCH 047/101] GHA: tests-shell: Corrects volumes --- .github/workflows/tests-shell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index ea69a86a..661ffb1b 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -29,7 +29,7 @@ jobs: image: ea31337/ea-tester:dev options: --user root volumes: - - ${{ github.workspace }}/scripts/tests:/opt/scripts + - ${{ github.workspace }}/scripts:/opt/scripts strategy: matrix: test: From d6ccc84e5286c7224f18defe2f42ad26a715efa8 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 17:36:11 +0000 Subject: [PATCH 048/101] GHA: tests-shell: Removes adding safe.directory step --- .github/workflows/tests-shell.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 661ffb1b..9c6efce1 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -41,9 +41,6 @@ jobs: - ./test_eval.sh - ./test_vars.sh steps: - - name: Adds safe directory - # Refs: https://github.com/actions/checkout/issues/760 - run: git config --global --add safe.directory /__w - uses: actions/checkout@v4 env: # Refs: https://github.com/actions/checkout/issues/956 From e6d404d31a36315019b4b81a3123f7c6f0058010 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 18:44:43 +0000 Subject: [PATCH 049/101] GHA: tests-shell: Adds env.PATH to run step --- .github/workflows/tests-shell.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 9c6efce1..2bbbd5cc 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -46,3 +46,5 @@ jobs: # Refs: https://github.com/actions/checkout/issues/956 GIT_CEILING_DIRECTORIES: /__w - run: ${{ matrix.test }} + env: + PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/scripts:/opt/scripts/py From e83343bd7bcb6395c0d2b935e63141bf0ea28488 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 19:34:59 +0000 Subject: [PATCH 050/101] GHA: Minor improvements --- scripts/tests/test_backtest.sh | 2 +- scripts/tests/test_cmds.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/tests/test_backtest.sh b/scripts/tests/test_backtest.sh index ba20a646..1a46c773 100755 --- a/scripts/tests/test_backtest.sh +++ b/scripts/tests/test_backtest.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Test run_backtest.sh file. -set -ex -o pipefail +set -eEx -o pipefail # Initialize. . ../.funcs.inc.sh diff --git a/scripts/tests/test_cmds.sh b/scripts/tests/test_cmds.sh index 79aa6693..17ddd075 100755 --- a/scripts/tests/test_cmds.sh +++ b/scripts/tests/test_cmds.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Test .funcs.cmds.inc.sh file. -set -eE -o pipefail +set -eEx -o pipefail # Initialize. . ../.funcs.inc.sh @@ -13,6 +13,7 @@ initialize help | grep "Usage" > /dev/null # Installs both platforms. +tail -f "${file_stderr}" & install_mt 4 /opt install_mt 5 /opt @@ -48,3 +49,6 @@ echo INFO: Test finding script files after copying... [ -f "$SCRIPTS_DIR/$(script_find Dummy)" ] [ -f "$SCRIPTS_DIR/$(MT_VER=4 script_find Dummy.mq4)" ] [ -f "$SCRIPTS_DIR/$(MT_VER=5 script_find Dummy.mq5)" ] + +kill_jobs +echo "${BASH_SOURCE[0]} done." From 0db0e766ad0df6e9624a7bdbaf734824fd042061 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 19:47:43 +0000 Subject: [PATCH 051/101] GHA: Adds with.path to checkout git repo to github.workspace --- .github/workflows/tests-shell.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 2bbbd5cc..f3d32ae7 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -45,6 +45,8 @@ jobs: env: # Refs: https://github.com/actions/checkout/issues/956 GIT_CEILING_DIRECTORIES: /__w + with: + path: ${{ github.workspace }} - run: ${{ matrix.test }} env: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/scripts:/opt/scripts/py From 412c65f9022f612156e098a4758fa40aad90d3f5 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 19:49:39 +0000 Subject: [PATCH 052/101] Revert "GHA: Minor improvements" This reverts commit e83343bd7bcb6395c0d2b935e63141bf0ea28488. --- scripts/tests/test_backtest.sh | 2 +- scripts/tests/test_cmds.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/tests/test_backtest.sh b/scripts/tests/test_backtest.sh index 1a46c773..ba20a646 100755 --- a/scripts/tests/test_backtest.sh +++ b/scripts/tests/test_backtest.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Test run_backtest.sh file. -set -eEx -o pipefail +set -ex -o pipefail # Initialize. . ../.funcs.inc.sh diff --git a/scripts/tests/test_cmds.sh b/scripts/tests/test_cmds.sh index 17ddd075..79aa6693 100755 --- a/scripts/tests/test_cmds.sh +++ b/scripts/tests/test_cmds.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Test .funcs.cmds.inc.sh file. -set -eEx -o pipefail +set -eE -o pipefail # Initialize. . ../.funcs.inc.sh @@ -13,7 +13,6 @@ initialize help | grep "Usage" > /dev/null # Installs both platforms. -tail -f "${file_stderr}" & install_mt 4 /opt install_mt 5 /opt @@ -49,6 +48,3 @@ echo INFO: Test finding script files after copying... [ -f "$SCRIPTS_DIR/$(script_find Dummy)" ] [ -f "$SCRIPTS_DIR/$(MT_VER=4 script_find Dummy.mq4)" ] [ -f "$SCRIPTS_DIR/$(MT_VER=5 script_find Dummy.mq5)" ] - -kill_jobs -echo "${BASH_SOURCE[0]} done." From 93777b7a66b3d843ce2bc2dd3d3c1c3fb7e9579b Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 19:50:46 +0000 Subject: [PATCH 053/101] GHA: Runs find /opt -print --- .github/workflows/tests-shell.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index f3d32ae7..02a3e709 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -47,6 +47,7 @@ jobs: GIT_CEILING_DIRECTORIES: /__w with: path: ${{ github.workspace }} + - run: find /opt -print - run: ${{ matrix.test }} env: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/scripts:/opt/scripts/py From e7e1e874e8421bbd0103bf87cc0778ca7da212eb Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 20:00:03 +0000 Subject: [PATCH 054/101] Removes git init from provisioning script --- scripts/provision.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index c6aae7e9..16c3b8fb 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -105,7 +105,6 @@ case "$(uname -s)" in # Install required commands if not present. command -v curl &> /dev/null || apt-get install -qq curl - command -v git &> /dev/null || apt-get install -qq git command -v pip &> /dev/null || apt-get install -qq pip command -v wget &> /dev/null || apt-get install -qq wget command -v ansible &> /dev/null || pip install ansible @@ -213,9 +212,6 @@ set +x git config --system core.sharedRepository group ) & -# Add version control for /opt. -git init /opt & - # Give user write permission for /opt. chown -R $user /opt & From 4100bbbdc3537eba8c3ede255abd9f6dbf81b96c Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 20:03:51 +0000 Subject: [PATCH 055/101] Uses GITHUB_WORKSPACE instead of github.workspace Refs: https://github.com/actions/runner/issues/2058 --- .github/workflows/tests-shell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 02a3e709..23ec0248 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -29,7 +29,7 @@ jobs: image: ea31337/ea-tester:dev options: --user root volumes: - - ${{ github.workspace }}/scripts:/opt/scripts + - ${GITHUB_WORKSPACE}/scripts:/opt/scripts strategy: matrix: test: From a5d453c113b7d2d9c8276157664b98c34c782eb7 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 20:08:56 +0000 Subject: [PATCH 056/101] Testing usage of env.GITHUB_WORKSPACE Refs: https://github.com/actions/runner/issues/2058 --- .github/workflows/tests-shell.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 23ec0248..a9ab84e8 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -29,7 +29,7 @@ jobs: image: ea31337/ea-tester:dev options: --user root volumes: - - ${GITHUB_WORKSPACE}/scripts:/opt/scripts + - ${{ env.GITHUB_WORKSPACE }}/scripts:/opt/scripts strategy: matrix: test: @@ -46,7 +46,7 @@ jobs: # Refs: https://github.com/actions/checkout/issues/956 GIT_CEILING_DIRECTORIES: /__w with: - path: ${{ github.workspace }} + path: ${{ env.GITHUB_WORKSPACE }} - run: find /opt -print - run: ${{ matrix.test }} env: From b735bd33fd01ca6c8e1efb3887c053f7564d7377 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 20:14:57 +0000 Subject: [PATCH 057/101] Hardcoding path due to bug Refs: https://github.com/actions/runner/issues/2058 --- .github/workflows/tests-shell.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index a9ab84e8..c2b98e01 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -29,7 +29,7 @@ jobs: image: ea31337/ea-tester:dev options: --user root volumes: - - ${{ env.GITHUB_WORKSPACE }}/scripts:/opt/scripts + - /__w/EA-Tester/EA-Tester/scripts:/opt/scripts strategy: matrix: test: @@ -47,7 +47,7 @@ jobs: GIT_CEILING_DIRECTORIES: /__w with: path: ${{ env.GITHUB_WORKSPACE }} - - run: find /opt -print + - 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 From 17ddf950860a799ea5ed38c204ff84dfe2dcd882 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 20:21:41 +0000 Subject: [PATCH 058/101] GHA: Uses symbolic link to resolve the issue with missing scripts directory --- .github/workflows/tests-shell.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index c2b98e01..465422ec 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -28,8 +28,6 @@ jobs: WINEPREFIX: /tmp/.wine image: ea31337/ea-tester:dev options: --user root - volumes: - - /__w/EA-Tester/EA-Tester/scripts:/opt/scripts strategy: matrix: test: @@ -45,8 +43,8 @@ jobs: env: # Refs: https://github.com/actions/checkout/issues/956 GIT_CEILING_DIRECTORIES: /__w - with: - path: ${{ env.GITHUB_WORKSPACE }} + - 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: From 0ad4956f88000415e856f72ffa7c11e5f7d26dd5 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 21:46:40 +0000 Subject: [PATCH 059/101] GHA: Upgrades actions/checkout to v4 --- .github/workflows/check.yml | 4 ++-- .github/workflows/docker.yml | 4 ++-- .github/workflows/sync-fork.yml | 4 ++-- .github/workflows/tests-mql.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 102193e0..1875e39b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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') }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1dc9d386..a39489aa 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,7 +27,7 @@ jobs: Hadolint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: brpaz/hadolint-action@master with: dockerfile: Dockerfile @@ -35,7 +35,7 @@ jobs: 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 diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml index 6a66bb92..432cd005 100644 --- a/.github/workflows/sync-fork.yml +++ b/.github/workflows/sync-fork.yml @@ -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 diff --git a/.github/workflows/tests-mql.yml b/.github/workflows/tests-mql.yml index 7e3d0b4e..a9122002 100644 --- a/.github/workflows/tests-mql.yml +++ b/.github/workflows/tests-mql.yml @@ -37,7 +37,7 @@ jobs: - TestModellingQuality - TestTimeframes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check dependencies if: github.actor == 'nektos/act' run: > @@ -61,7 +61,7 @@ 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: > From 5419bf1b54a895bb6958e05f9c138c7e198310e1 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 21:50:11 +0000 Subject: [PATCH 060/101] Re-adds git install to provision script --- scripts/provision.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/provision.sh b/scripts/provision.sh index 16c3b8fb..e19d7429 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -105,6 +105,7 @@ case "$(uname -s)" in # Install required commands if not present. command -v curl &> /dev/null || apt-get install -qq curl + command -v git &> /dev/null || apt-get install -qq git command -v pip &> /dev/null || apt-get install -qq pip command -v wget &> /dev/null || apt-get install -qq wget command -v ansible &> /dev/null || pip install ansible From fbad6095e2fe6e677f194c24332f32ba79f39b72 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 22:00:59 +0000 Subject: [PATCH 061/101] Installs x11-utils by default --- ansible/install-xvfb.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/install-xvfb.yml b/ansible/install-xvfb.yml index 7647ca63..d879aa40 100644 --- a/ansible/install-xvfb.yml +++ b/ansible/install-xvfb.yml @@ -1,3 +1,5 @@ --- - hosts: all roles: [ea31337.xvfb] + vars: + xvfb_install_x11_utils: true From 3374079d18f17fa08574c88874498aa3fa9cf050 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 10 Feb 2024 22:03:12 +0000 Subject: [PATCH 062/101] Moves wine_install_winetricks to playbook --- ansible/install-wine.yml | 2 ++ scripts/provision.sh | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ansible/install-wine.yml b/ansible/install-wine.yml index e2b238b3..5a1b83a3 100644 --- a/ansible/install-wine.yml +++ b/ansible/install-wine.yml @@ -1,3 +1,5 @@ --- - hosts: all roles: [ea31337.wine] + vars: + wine_install_winetricks: true diff --git a/scripts/provision.sh b/scripts/provision.sh index e19d7429..b600da18 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -114,8 +114,7 @@ case "$(uname -s)" in ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml # Install platform. - ansible-playbook -i "localhost," -c local /opt/ansible/install-wine.yml -v \ - -e wine_install_winetricks=1 + ansible-playbook -i "localhost," -c local /opt/ansible/install-wine.yml -v ansible-playbook -i "localhost," -c local /opt/ansible/install-xvfb.yml -v # Install Charles proxy. From dfff3a47dce29494e5feb9fa96ffae26adf4f949 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 00:45:26 +0000 Subject: [PATCH 063/101] GHA: Sets timeout-minutes to 20 minutes --- .github/workflows/tests-shell.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 465422ec..b8fc6cb4 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -49,3 +49,4 @@ jobs: - 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 From 6feb47d894e51b8b07b61c03840434c1261a432e Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 01:08:44 +0000 Subject: [PATCH 064/101] Corrects platform installation scripts --- .github/workflows/compile.yml | 22 ++++++++++++++++++++-- ansible/install-mt4.yml | 6 ++++++ ansible/install-platform.yml | 3 --- scripts/install_mt4.sh | 3 +-- scripts/install_mt5.sh | 3 +-- 5 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 ansible/install-mt4.yml delete mode 100644 ansible/install-platform.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 2a91da2e..16036a75 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -16,14 +16,32 @@ on: - '.github/workflows/compile.yml' jobs: - Compile: + Compile-MT4: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Installs platform uses: dawidd6/action-ansible-playbook@v2 with: - playbook: install-platform.yml + 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 diff --git a/ansible/install-mt4.yml b/ansible/install-mt4.yml new file mode 100644 index 00000000..083bed4e --- /dev/null +++ b/ansible/install-mt4.yml @@ -0,0 +1,6 @@ +--- +- hosts: all + roles: [ea31337.metatrader] + vars: + metatrader_setup_url: https://download.mql5.com/cdn/web/8472/mt4/xmuk4setup.exe + metatrader_version: 4 diff --git a/ansible/install-platform.yml b/ansible/install-platform.yml deleted file mode 100644 index 6ce6fa60..00000000 --- a/ansible/install-platform.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- hosts: all - roles: [ea31337.metatrader] diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index f22fa6e9..7f3ce297 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -27,8 +27,7 @@ ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml # Install platform. echo "Installing platform..." >&2 -ansible-playbook -c local -e metatrader_version=4 -e wine_install_winetricks=1 \ - -i "localhost," /opt/ansible/install-platform.yml -v +ansible-playbook -c local -i "localhost," /opt/ansible/install-mt4.yml -v . "$CWD"/.vars.inc.sh if [ -n "$TERMINAL5_DIR" ]; then diff --git a/scripts/install_mt5.sh b/scripts/install_mt5.sh index cf601aea..e3a6b16b 100755 --- a/scripts/install_mt5.sh +++ b/scripts/install_mt5.sh @@ -27,8 +27,7 @@ ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml # Install platform. echo "Installing platform..." >&2 -ansible-playbook -c local -e metatrader_version=5 -e wine_install_winetricks=1 \ - -i "localhost," /opt/ansible/install-platform.yml -v +ansible-playbook -c local -i "localhost," /opt/ansible/install-mt5.yml -v . "$CWD"/.vars.inc.sh if [ -n "$TERMINAL5_DIR" ]; then From ad96834508dc96e618841814e1a3ea66c836ec16 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 01:24:34 +0000 Subject: [PATCH 065/101] Corrects playbook syntax with variables --- ansible/install-mt4.yml | 9 +++++---- ansible/install-wine.yml | 7 ++++--- ansible/install-xvfb.yml | 7 ++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ansible/install-mt4.yml b/ansible/install-mt4.yml index 083bed4e..a76bf2e4 100644 --- a/ansible/install-mt4.yml +++ b/ansible/install-mt4.yml @@ -1,6 +1,7 @@ --- - hosts: all - roles: [ea31337.metatrader] - vars: - metatrader_setup_url: https://download.mql5.com/cdn/web/8472/mt4/xmuk4setup.exe - metatrader_version: 4 + roles: + - role: ea31337.metatrader + vars: + metatrader_setup_url: https://download.mql5.com/cdn/web/3315/mt4/xm4setup.exe + metatrader_version: 4 diff --git a/ansible/install-wine.yml b/ansible/install-wine.yml index 5a1b83a3..7134b015 100644 --- a/ansible/install-wine.yml +++ b/ansible/install-wine.yml @@ -1,5 +1,6 @@ --- - hosts: all - roles: [ea31337.wine] - vars: - wine_install_winetricks: true + roles: + - role: ea31337.wine + vars: + wine_install_winetricks: true diff --git a/ansible/install-xvfb.yml b/ansible/install-xvfb.yml index d879aa40..06ec61e7 100644 --- a/ansible/install-xvfb.yml +++ b/ansible/install-xvfb.yml @@ -1,5 +1,6 @@ --- - hosts: all - roles: [ea31337.xvfb] - vars: - xvfb_install_x11_utils: true + roles: + - role: ea31337.xvfb + vars: + xvfb_install_x11_utils: true From 716a8fe45cf68bf300e150e99addee658e57e93f Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 01:31:57 +0000 Subject: [PATCH 066/101] Adds install-mt5.yml --- ansible/install-mt5.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ansible/install-mt5.yml diff --git a/ansible/install-mt5.yml b/ansible/install-mt5.yml new file mode 100644 index 00000000..51c54037 --- /dev/null +++ b/ansible/install-mt5.yml @@ -0,0 +1,7 @@ +--- +- hosts: all + roles: + - role: ea31337.metatrader + vars: + metatrader_setup_url: https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe + metatrader_version: 5 From 616c0fae6551362f79c42d111a793d7ea2540562 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 01:36:30 +0000 Subject: [PATCH 067/101] Removes verb files as redundant --- scripts/verb/install_mt4.verb | 36 ----------------------------------- scripts/verb/install_mt5.verb | 31 ------------------------------ 2 files changed, 67 deletions(-) delete mode 100644 scripts/verb/install_mt4.verb delete mode 100644 scripts/verb/install_mt5.verb diff --git a/scripts/verb/install_mt4.verb b/scripts/verb/install_mt4.verb deleted file mode 100644 index 9ec86138..00000000 --- a/scripts/verb/install_mt4.verb +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -w_metadata mt4_install apps \ - title="MetaTrader 4" \ - year="2021" \ - media="download" - -load_mt4_install() -{ - w_download ${MT_URL:-"https://download.mql5.com/cdn/web/8472/mt4/xmuk4setup.exe"} - - if w_workaround_wine_bug 7156 "${title} needs wingdings.ttf, installing opensymbol" - then - w_call opensymbol - fi - - # Opens a webpage. - WINEDLLOVERRIDES="winebrowser.exe=" - export WINEDLLOVERRIDES - - # No documented silent install option, unfortunately. - w_try_cd "$W_CACHE/$W_PACKAGE" - w_ahk_do " - Run, "$(echo *.exe)" - SetTitleMatchMode, RegEx - WinWait, 4 Setup - Send, !n - Sleep, 20000 - Send, {Tab}{Enter} - Process, Wait, terminal.exe, 5 - WinWaitActive, ahk_class MetaQuotes::MetaTrader::4.00 - Send, {Esc}, {Esc}, !fx, !{F4} ; File->Exit, Alt-F4 - WinWaitClose, ahk_exe terminal.exe, 2 - Process, Close, terminal.exe - " -} diff --git a/scripts/verb/install_mt5.verb b/scripts/verb/install_mt5.verb deleted file mode 100644 index 7b52b888..00000000 --- a/scripts/verb/install_mt5.verb +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -w_metadata mt5_install apps \ - title="MetaTrader 5" \ - year="2021" \ - media="download" - -load_mt5_install() -{ - w_download ${MT_URL:-"https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe"} - - if w_workaround_wine_bug 7156 "${title} needs wingdings.ttf, installing opensymbol" - then - w_call opensymbol - fi - - WINEDLLOVERRIDES="winebrowser.exe=" - export WINEDLLOVERRIDES - - w_try_cd "$W_CACHE/$W_PACKAGE" - w_ahk_do " - Run, "$(echo *.exe)" - SetTitleMatchMode, RegEx - WinWait, MetaTrader 5,, 30 - Send, {Enter} - WinWait, MetaTrader 5 Setup, Congratulations! - Send, {Tab}{Enter} - Process, Wait, terminal64.exe, 30 - Process, Close, terminal64.exe - " -} From 7973093b8daf64d712707f943e619ac087634fd9 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 15:57:35 +0000 Subject: [PATCH 068/101] scripts/install_mt4: Corrects typo --- scripts/install_mt4.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index 7f3ce297..5e80bab3 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -30,7 +30,7 @@ echo "Installing platform..." >&2 ansible-playbook -c local -i "localhost," /opt/ansible/install-mt4.yml -v . "$CWD"/.vars.inc.sh -if [ -n "$TERMINAL5_DIR" ]; then +if [ -n "$TERMINAL4_DIR" ]; then echo "Terminal path: $TERMINAL5_DIR" >&2 echo "Installation successful." >&2 else From 5757b136d68f1eb1fff95568e3bc10ad4a29eda0 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 16:12:40 +0000 Subject: [PATCH 069/101] Installs required utils via Ansible --- ansible/install-utils.yml | 25 +++++++++++++++++++++++++ scripts/provision.sh | 15 +++------------ 2 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 ansible/install-utils.yml diff --git a/ansible/install-utils.yml b/ansible/install-utils.yml new file mode 100644 index 00000000..e71f3593 --- /dev/null +++ b/ansible/install-utils.yml @@ -0,0 +1,25 @@ +--- +- hosts: all + tasks: + - name: Ensures required utils are installed + ansible.builtin.package: + name: + - bc + - binutils + - cabextract + - coreutils + - curl + - git + - html2text + - imagemagick + - jq + - less + - links + - moreutils + - p7zip-full + - pv + - tree + - unzip + - vim + - wget + - zip diff --git a/scripts/provision.sh b/scripts/provision.sh index b600da18..f7699450 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -104,12 +104,12 @@ case "$(uname -s)" in ) # Install required commands if not present. - command -v curl &> /dev/null || apt-get install -qq curl - command -v git &> /dev/null || apt-get install -qq git command -v pip &> /dev/null || apt-get install -qq pip - command -v wget &> /dev/null || apt-get install -qq wget command -v ansible &> /dev/null || pip install ansible + # Install required utilities. + ansible-playbook -i "localhost," -c local /opt/ansible/install-utils.yml -v + # Install Ansible Galaxy requirements. ansible-galaxy install -r /opt/ansible/galaxy-requirements.yml @@ -152,15 +152,6 @@ case "$(uname -s)" in apt-get install -qq x11vnc fluxbox fi - # Install other CLI tools. - apt-get install -qq less binutils coreutils moreutils # Common CLI utils. - apt-get install -qq cabextract zip p7zip-full # Compression tools. - apt-get install -qq git links tree pv bc # Required commands. - apt-get install -qq realpath || true # Install realpath if available. - apt-get install -qq html2text jq # Required parsers. - apt-get install -qq imagemagick # ImageMagick. - apt-get install -qq vim # Vim. - # Configures ImageMagick. # See: https://stackoverflow.com/q/42928765 [ -f /etc/ImageMagick-6/policy.xml ] && rm -v /etc/ImageMagick-6/policy.xml From 80b05ec3281f038bc8cc1ccfb97598ae7be7ce5e Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 16:19:08 +0000 Subject: [PATCH 070/101] scripts/install_mt4: Corrects another typo --- scripts/install_mt4.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_mt4.sh b/scripts/install_mt4.sh index 5e80bab3..ef69ee36 100755 --- a/scripts/install_mt4.sh +++ b/scripts/install_mt4.sh @@ -31,7 +31,7 @@ ansible-playbook -c local -i "localhost," /opt/ansible/install-mt4.yml -v . "$CWD"/.vars.inc.sh if [ -n "$TERMINAL4_DIR" ]; then - echo "Terminal path: $TERMINAL5_DIR" >&2 + echo "Terminal path: $TERMINAL4_DIR" >&2 echo "Installation successful." >&2 else echo "Installation failed!" >&2 From b9daf0102f4802a103b39ceb20f5d0a41ae4465d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 16:35:43 +0000 Subject: [PATCH 071/101] test_backtest: Improves stdout handling --- scripts/tests/test_backtest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tests/test_backtest.sh b/scripts/tests/test_backtest.sh index ba20a646..137b76b5 100755 --- a/scripts/tests/test_backtest.sh +++ b/scripts/tests/test_backtest.sh @@ -25,8 +25,8 @@ export RUN_ON_ERROR="tail $file_stdout $file_stderr" # Installs both platforms. tail -f "${file_stderr}" & -install_mt 4 /opt 1> $file_stdout 2> $file_stderr -install_mt 5 /opt 1> $file_stdout 2> $file_stderr +install_mt 4 /opt 2> $file_stderr | tee -a $file_stdout +install_mt 5 /opt 2> $file_stderr | tee -a $file_stdout ## Checks backtest with missing parameters. ! run_backtest -_ 1> $file_stdout 2> $file_stderr From 142e9cfd2c09c922b6c3672b1f058416c7f1702f Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:03:07 +0000 Subject: [PATCH 072/101] GHA: Adds platform.yml workflow --- .github/workflows/platform.yml | 66 ++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/platform.yml diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml new file mode 100644 index 00000000..c6630302 --- /dev/null +++ b/.github/workflows/platform.yml @@ -0,0 +1,66 @@ +--- +name: Platform + +env: + ARTIFACT_NAME: ${{ inputs.artifact || 'platform' }} + VERSION: ${{ inputs.version || 5 }} + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - '.github/workflows/platform.yml' + push: + branches: + - 'master' + - '*dev*' + paths: + - '.github/workflows/platform.yml' + workflow_call: + inputs: + artifact: + default: platform + description: Artifact name + required: false + type: string + version: + default: 5 + description: Version to install + type: number + +jobs: + platform-linux: + name: Platform (Linux) + outputs: + workdir: ${{ github.workspace }} + runs-on: ubuntu-latest + steps: + - name: Runs playbook + uses: dawidd6/action-ansible-playbook@v2 + with: + configuration: | + [defaults] + nocows = false + stdout_callback = yaml + options: | + --connection local + --inventory localhost, + --verbose + playbook: molecule/mt${{ env.VERSION }}/converge.yml + requirements: ansible/galaxy-requirements.yml + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.ARTIFACT_NAME }} + path: | + ~/.wine/drive_c/Program Files*/**/*MT* + ~/.wine/drive_c/Program Files*/**/*Meta* + timeout-minutes: 20 + cleanup: + if: ${{ github.event_name != 'workflow_call' }} + name: Clean-up + needs: [platform-linux] + runs-on: ubuntu-latest + steps: + - uses: geekyeggo/delete-artifact@v4 + with: + name: ${{ env.ARTIFACT_NAME }} From 60e61a7ab8d7a3852f89f0e7a600020a4c0c61a8 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:05:37 +0000 Subject: [PATCH 073/101] GHA: Do not run docker workflow for .github path changes --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a39489aa..3e1268e3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -16,6 +16,7 @@ on: - '**/*.md' - '**/*.txt' - '.*' + - '.github/**' # Sequence of patterns matched against refs/tags. tags: - 'v1.*' From 05d7aedc13046904281dd209ee1353047e57b29e Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:14:11 +0000 Subject: [PATCH 074/101] GHA: Adds actions/checkout to platform workflow --- .github/workflows/platform.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index c6630302..70f4a17e 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -3,6 +3,8 @@ name: Platform env: ARTIFACT_NAME: ${{ inputs.artifact || 'platform' }} + CHECKOUT_REF: ${{ inputs.ref || 'dev' }} + REPOSITORY: EA31337/EA-Tester VERSION: ${{ inputs.version || 5 }} # yamllint disable-line rule:truthy @@ -23,6 +25,11 @@ on: description: Artifact name required: false type: string + ref: + default: dev + description: The branch, tag or SHA to checkout. + required: false + type: string version: default: 5 description: Version to install @@ -35,6 +42,10 @@ jobs: workdir: ${{ github.workspace }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + ref: ${{ env.CHECKOUT_REF }} + repository: ${{ env.REPOSITORY }} - name: Runs playbook uses: dawidd6/action-ansible-playbook@v2 with: @@ -42,12 +53,13 @@ jobs: [defaults] nocows = false stdout_callback = yaml + directory: ansible options: | --connection local --inventory localhost, --verbose - playbook: molecule/mt${{ env.VERSION }}/converge.yml - requirements: ansible/galaxy-requirements.yml + playbook: install-mt${{ env.VERSION }}.yml + requirements: galaxy-requirements.yml - uses: actions/upload-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} From 57e20edea9b3a6775b0f342f52f1b4a8bff4c1cb Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:28:39 +0000 Subject: [PATCH 075/101] GHA: Platform: Improves name of job --- .github/workflows/platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 70f4a17e..1bcf09db 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -37,7 +37,7 @@ on: jobs: platform-linux: - name: Platform (Linux) + name: Platform ${{ env.VERSION }} (Linux) outputs: workdir: ${{ github.workspace }} runs-on: ubuntu-latest From 9d10a02c36459f33d2789650185334d02cc0605d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:33:00 +0000 Subject: [PATCH 076/101] GHA: Updates if condition for clean-up --- .github/workflows/platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 1bcf09db..c351520d 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -68,7 +68,7 @@ jobs: ~/.wine/drive_c/Program Files*/**/*Meta* timeout-minutes: 20 cleanup: - if: ${{ github.event_name != 'workflow_call' }} + if: ${{ github.event.inputs == undefined }} name: Clean-up needs: [platform-linux] runs-on: ubuntu-latest From 34f31fa2f4521ba9c0abd61133ff3517f54d4a5f Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:34:32 +0000 Subject: [PATCH 077/101] GHA: Checking if $VERSION can work --- .github/workflows/platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index c351520d..16adc7f2 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -37,7 +37,7 @@ on: jobs: platform-linux: - name: Platform ${{ env.VERSION }} (Linux) + name: Platform ${VERSION} (Linux) outputs: workdir: ${{ github.workspace }} runs-on: ubuntu-latest From 8446ce698cc7e20e378768c3a60cf2a54da9e1fe Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:35:50 +0000 Subject: [PATCH 078/101] GHA Corrects cleanup if condition --- .github/workflows/platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 16adc7f2..a75ca3db 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -68,7 +68,7 @@ jobs: ~/.wine/drive_c/Program Files*/**/*Meta* timeout-minutes: 20 cleanup: - if: ${{ github.event.inputs == undefined }} + if: ${{ github.event.inputs != '' }} name: Clean-up needs: [platform-linux] runs-on: ubuntu-latest From a86d989a07ea82f1e70b51c5dddc4da1c9f6feb2 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:36:42 +0000 Subject: [PATCH 079/101] GHA: Removes ${VERSION} from name as it does not work --- .github/workflows/platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index a75ca3db..a8dce387 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -37,7 +37,7 @@ on: jobs: platform-linux: - name: Platform ${VERSION} (Linux) + name: Platform (Linux) outputs: workdir: ${{ github.workspace }} runs-on: ubuntu-latest From 42552130170f7d116a96a0a481e03d00a3e0e090 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:37:39 +0000 Subject: [PATCH 080/101] Renames platform to platform-linux --- .github/workflows/{platform.yml => platform-linux.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{platform.yml => platform-linux.yml} (97%) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform-linux.yml similarity index 97% rename from .github/workflows/platform.yml rename to .github/workflows/platform-linux.yml index a8dce387..ce802cdb 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform-linux.yml @@ -1,5 +1,5 @@ --- -name: Platform +name: Platform (Linux) env: ARTIFACT_NAME: ${{ inputs.artifact || 'platform' }} @@ -37,7 +37,7 @@ on: jobs: platform-linux: - name: Platform (Linux) + name: Platform outputs: workdir: ${{ github.workspace }} runs-on: ubuntu-latest From bad2b1eaa247f215921ee60dd65279bb03e02adf Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:40:04 +0000 Subject: [PATCH 081/101] GHA: Runs clean-up job when inputs are empty --- .github/workflows/platform-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index ce802cdb..b41f6d1d 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -68,7 +68,7 @@ jobs: ~/.wine/drive_c/Program Files*/**/*Meta* timeout-minutes: 20 cleanup: - if: ${{ github.event.inputs != '' }} + if: ${{ github.event.inputs == '' }} name: Clean-up needs: [platform-linux] runs-on: ubuntu-latest From d9ed76d69fa6e399fb7b4717602fdf86bf786ff4 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 22:52:52 +0000 Subject: [PATCH 082/101] GHA: Fixes clean-up if condition --- .github/workflows/platform-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index b41f6d1d..8ba91f9b 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -68,7 +68,7 @@ jobs: ~/.wine/drive_c/Program Files*/**/*Meta* timeout-minutes: 20 cleanup: - if: ${{ github.event.inputs == '' }} + if: ${{ github.event.inputs.version == null }} name: Clean-up needs: [platform-linux] runs-on: ubuntu-latest From 8dfcaa4789c594cfd088c4523a22353696e1c867 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 23:11:15 +0000 Subject: [PATCH 083/101] GHA: Testing new cleanup if condition --- .github/workflows/platform-linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 8ba91f9b..b9b15e0b 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -68,11 +68,12 @@ jobs: ~/.wine/drive_c/Program Files*/**/*Meta* timeout-minutes: 20 cleanup: - if: ${{ github.event.inputs.version == null }} + if: ${{ ! github.event.inputs.artifact }} name: Clean-up needs: [platform-linux] runs-on: ubuntu-latest steps: - uses: geekyeggo/delete-artifact@v4 + if: ${{ ! github.event.inputs.artifact }} with: name: ${{ env.ARTIFACT_NAME }} From 329f295099a3e87ee137c3500a2d9cb6b3c41bea Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 23:12:14 +0000 Subject: [PATCH 084/101] GHA: Corrects paths --- .github/workflows/platform-linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index b9b15e0b..0c757355 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -11,13 +11,13 @@ env: on: pull_request: paths: - - '.github/workflows/platform.yml' + - '.github/workflows/platform-linux.yml' push: branches: - 'master' - '*dev*' paths: - - '.github/workflows/platform.yml' + - '.github/workflows/platform-linux.yml' workflow_call: inputs: artifact: From 6faaa6fdd47f3b4e52bda03a1dcec5c3ddc20503 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 23:31:05 +0000 Subject: [PATCH 085/101] GHA: Testing new if condition for cleanup --- .github/workflows/platform-linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 0c757355..e2db9593 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -68,12 +68,12 @@ jobs: ~/.wine/drive_c/Program Files*/**/*Meta* timeout-minutes: 20 cleanup: - if: ${{ ! github.event.inputs.artifact }} + if: not(github.event.inputs.artifact) name: Clean-up needs: [platform-linux] runs-on: ubuntu-latest steps: - uses: geekyeggo/delete-artifact@v4 - if: ${{ ! github.event.inputs.artifact }} + if: not(github.event.inputs.artifact) with: name: ${{ env.ARTIFACT_NAME }} From 1c862c8c4462308b9903fb1dc3a21b77e5dc984a Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 23:35:15 +0000 Subject: [PATCH 086/101] GHA: Adds inputs.cleanup --- .github/workflows/platform-linux.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index e2db9593..81bdcd2b 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -4,6 +4,7 @@ name: Platform (Linux) env: ARTIFACT_NAME: ${{ inputs.artifact || 'platform' }} CHECKOUT_REF: ${{ inputs.ref || 'dev' }} + CLEANUP: ${{ inputs.cleanup || false }} REPOSITORY: EA31337/EA-Tester VERSION: ${{ inputs.version || 5 }} @@ -25,6 +26,11 @@ on: description: Artifact name required: false type: string + cleanup: + default: false + description: Whether to run clean-up job + required: false + type: boolean ref: default: dev description: The branch, tag or SHA to checkout. @@ -68,12 +74,11 @@ jobs: ~/.wine/drive_c/Program Files*/**/*Meta* timeout-minutes: 20 cleanup: - if: not(github.event.inputs.artifact) name: Clean-up needs: [platform-linux] runs-on: ubuntu-latest steps: - uses: geekyeggo/delete-artifact@v4 - if: not(github.event.inputs.artifact) + if: env.CLEANUP with: name: ${{ env.ARTIFACT_NAME }} From fd0a21743aa3e1659eb115ca63f1b677cf89503e Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 11 Feb 2024 23:51:37 +0000 Subject: [PATCH 087/101] GHA: Adds if github.repository condition --- .github/workflows/platform-linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 81bdcd2b..3cd0c942 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -4,7 +4,7 @@ name: Platform (Linux) env: ARTIFACT_NAME: ${{ inputs.artifact || 'platform' }} CHECKOUT_REF: ${{ inputs.ref || 'dev' }} - CLEANUP: ${{ inputs.cleanup || false }} + CLEANUP: ${{ inputs.cleanup || true }} REPOSITORY: EA31337/EA-Tester VERSION: ${{ inputs.version || 5 }} @@ -79,6 +79,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: geekyeggo/delete-artifact@v4 - if: env.CLEANUP + if: env.CLEANUP && github.repository == env.REPOSITORY with: name: ${{ env.ARTIFACT_NAME }} From 8b1cc37557e1b3502f1afcfdea73e6aa036484c3 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Feb 2024 21:14:33 +0000 Subject: [PATCH 088/101] Adds artifact_overwrite workflow input --- .github/workflows/platform-linux.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 3cd0c942..94a1148d 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -3,6 +3,7 @@ name: Platform (Linux) env: ARTIFACT_NAME: ${{ inputs.artifact || 'platform' }} + ARTIFACT_OVERWRITE: ${{ inputs.artifact_overwrite || false }} CHECKOUT_REF: ${{ inputs.ref || 'dev' }} CLEANUP: ${{ inputs.cleanup || true }} REPOSITORY: EA31337/EA-Tester @@ -23,12 +24,17 @@ on: inputs: artifact: default: platform - description: Artifact name + description: Artifact name. required: false type: string + artifact_overwrite: + default: false + description: Whether to overwrite artifact. + required: false + type: boolean cleanup: default: false - description: Whether to run clean-up job + description: Whether to run clean-up job. required: false type: boolean ref: @@ -38,7 +44,7 @@ on: type: string version: default: 5 - description: Version to install + description: Version to install. type: number jobs: @@ -72,6 +78,7 @@ jobs: path: | ~/.wine/drive_c/Program Files*/**/*MT* ~/.wine/drive_c/Program Files*/**/*Meta* + overwrite: ${{ env.ARTIFACT_OVERWRITE }} timeout-minutes: 20 cleanup: name: Clean-up From 421fc6edb50b6a93e52c6135a099ebfece1c30e0 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Feb 2024 21:15:47 +0000 Subject: [PATCH 089/101] GHA: Renames artifact input to artifact_name --- .github/workflows/platform-linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 94a1148d..6087f948 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -2,7 +2,7 @@ name: Platform (Linux) env: - ARTIFACT_NAME: ${{ inputs.artifact || 'platform' }} + ARTIFACT_NAME: ${{ inputs.artifact_name || 'platform' }} ARTIFACT_OVERWRITE: ${{ inputs.artifact_overwrite || false }} CHECKOUT_REF: ${{ inputs.ref || 'dev' }} CLEANUP: ${{ inputs.cleanup || true }} @@ -22,7 +22,7 @@ on: - '.github/workflows/platform-linux.yml' workflow_call: inputs: - artifact: + artifact_name: default: platform description: Artifact name. required: false From 6b52cdc0b2fa12c2323a13a7957c9d15bd4e2fd4 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 21 Apr 2024 23:42:33 +0100 Subject: [PATCH 090/101] GHA: Adds support for cache --- .github/workflows/platform-linux.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 6087f948..99b80e4e 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -4,6 +4,7 @@ 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' }} CLEANUP: ${{ inputs.cleanup || true }} REPOSITORY: EA31337/EA-Tester @@ -32,6 +33,11 @@ on: description: Whether to overwrite artifact. required: false type: boolean + cache: + default: true + description: Whether to use cache. + required: false + type: boolean cleanup: default: false description: Whether to run clean-up job. @@ -58,7 +64,14 @@ jobs: with: ref: ${{ env.CHECKOUT_REF }} repository: ${{ env.REPOSITORY }} - - name: Runs playbook + - id: cache-mt + if: env.CACHE + uses: actions/cache@v4 + with: + path: ~/.wine/drive_c + key: ${{ env.ARTIFACT_NAME }}-${{ env.CHECKOUT_REF }}-${{ env.VERSION }} + - if: steps.cache-mt.outputs.cache-hit != 'true' + name: Runs playbook uses: dawidd6/action-ansible-playbook@v2 with: configuration: | From 9e56a6ef9b4ddbbe42c42d80e2604abc90836d68 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 21 Apr 2024 23:55:10 +0100 Subject: [PATCH 091/101] GHA: Improves cache key --- .github/workflows/platform-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 99b80e4e..8da349c4 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -69,7 +69,7 @@ jobs: uses: actions/cache@v4 with: path: ~/.wine/drive_c - key: ${{ env.ARTIFACT_NAME }}-${{ env.CHECKOUT_REF }}-${{ env.VERSION }} + key: ${{ env.ARTIFACT_NAME }}/${{ env.CHECKOUT_REF }}/${{ env.VERSION }} - if: steps.cache-mt.outputs.cache-hit != 'true' name: Runs playbook uses: dawidd6/action-ansible-playbook@v2 From fea487870c47c3469bc5c2637c53c670c8e03796 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 22 Apr 2024 00:02:07 +0100 Subject: [PATCH 092/101] GHA: Adds hashFiles() to cache key --- .github/workflows/platform-linux.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 8da349c4..a80d21ad 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -68,8 +68,10 @@ jobs: if: env.CACHE uses: actions/cache@v4 with: - path: ~/.wine/drive_c - key: ${{ env.ARTIFACT_NAME }}/${{ env.CHECKOUT_REF }}/${{ env.VERSION }} + path: | + /etc/ansible/facts.d + ~/.wine/drive_c + key: ${{ env.ARTIFACT_NAME }}/${{ env.CHECKOUT_REF }}/${{ env.VERSION }}/${{ hashFiles('/etc/ansible/facts.d') }} - if: steps.cache-mt.outputs.cache-hit != 'true' name: Runs playbook uses: dawidd6/action-ansible-playbook@v2 From 93c67aae34f88acf54dc2db36e1c10629354b95c Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 22 Apr 2024 00:24:39 +0100 Subject: [PATCH 093/101] Revert "GHA: Adds hashFiles() to cache key" This reverts commit fea487870c47c3469bc5c2637c53c670c8e03796. --- .github/workflows/platform-linux.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index a80d21ad..8da349c4 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -68,10 +68,8 @@ jobs: if: env.CACHE uses: actions/cache@v4 with: - path: | - /etc/ansible/facts.d - ~/.wine/drive_c - key: ${{ env.ARTIFACT_NAME }}/${{ env.CHECKOUT_REF }}/${{ env.VERSION }}/${{ hashFiles('/etc/ansible/facts.d') }} + path: ~/.wine/drive_c + key: ${{ env.ARTIFACT_NAME }}/${{ env.CHECKOUT_REF }}/${{ env.VERSION }} - if: steps.cache-mt.outputs.cache-hit != 'true' name: Runs playbook uses: dawidd6/action-ansible-playbook@v2 From ee91fcb4c9da0940b19b5d111550dbb427a9b896 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 22 Apr 2024 00:33:39 +0100 Subject: [PATCH 094/101] GHA: Drops artifact name from the cache key --- .github/workflows/platform-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 8da349c4..4aa231f3 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -69,7 +69,7 @@ jobs: uses: actions/cache@v4 with: path: ~/.wine/drive_c - key: ${{ env.ARTIFACT_NAME }}/${{ env.CHECKOUT_REF }}/${{ env.VERSION }} + key: ${{ env.CHECKOUT_REF }}/${{ env.VERSION }} - if: steps.cache-mt.outputs.cache-hit != 'true' name: Runs playbook uses: dawidd6/action-ansible-playbook@v2 From 1685745217482e52a8cb98b8c0409072d57da591 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 22 Apr 2024 00:43:42 +0100 Subject: [PATCH 095/101] GHA: Improves cache key by adding hash of the workflow file --- .github/workflows/platform-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 4aa231f3..f3b22506 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -69,7 +69,7 @@ jobs: uses: actions/cache@v4 with: path: ~/.wine/drive_c - key: ${{ env.CHECKOUT_REF }}/${{ env.VERSION }} + 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 From 0a4f11a5a9f85f5c0a6744763c81af69f360790b Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 22 Apr 2024 18:22:31 +0100 Subject: [PATCH 096/101] GHA: platform-linux: Renames cleanup input to skip_cleanup --- .github/workflows/platform-linux.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index f3b22506..11067dd5 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -6,8 +6,8 @@ env: ARTIFACT_OVERWRITE: ${{ inputs.artifact_overwrite || false }} CACHE: ${{ inputs.cache || true }} CHECKOUT_REF: ${{ inputs.ref || 'dev' }} - CLEANUP: ${{ inputs.cleanup || true }} REPOSITORY: EA31337/EA-Tester + SKIP_CLEANUP: ${{ inputs.skip_cleanup || false }} VERSION: ${{ inputs.version || 5 }} # yamllint disable-line rule:truthy @@ -38,16 +38,16 @@ on: description: Whether to use cache. required: false type: boolean - cleanup: - default: false - description: Whether to run clean-up job. - 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. @@ -94,11 +94,11 @@ jobs: 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@v4 - if: env.CLEANUP && github.repository == env.REPOSITORY with: name: ${{ env.ARTIFACT_NAME }} From 900a45335b912913fdba109d196e5eaf85920914 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 22 Apr 2024 18:29:05 +0100 Subject: [PATCH 097/101] GHA: platform-linux: Adds /etc/ansible/facts.d to the caching path list --- .github/workflows/platform-linux.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 11067dd5..a66c431b 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -68,7 +68,9 @@ jobs: if: env.CACHE uses: actions/cache@v4 with: - path: ~/.wine/drive_c + path: | + /etc/ansible/facts.d + ~/.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 From 6e40fad144c1e1ba57ce7b314778ecb60b19bd5b Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 22 Apr 2024 18:48:23 +0100 Subject: [PATCH 098/101] GHA: platform-linux: Adds support for outputs --- .github/workflows/platform-linux.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index a66c431b..3166c9aa 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -52,12 +52,18 @@ on: default: 5 description: Version to install. type: number + # Map the workflow outputs to job outputs. + outputs: + platform: + description: Platform details. + value: ${{ jobs.platform-linux.outputs.platform || '{}' }} jobs: platform-linux: name: Platform + # Map the job outputs to step outputs. outputs: - workdir: ${{ github.workspace }} + platform: ${{ steps.out-mt-fact.outputs.platform }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -87,8 +93,12 @@ jobs: --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* From 7297ef169d959c5c8584698b30225d341f79aed0 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 23 Apr 2024 21:50:28 +0100 Subject: [PATCH 099/101] GHA: Upgrades geekyeggo/delete-artifact to v5 due to bug Refs: https://github.com/GeekyEggo/delete-artifact/issues/25 --- .github/workflows/platform-linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index 3166c9aa..ffff82df 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -55,7 +55,7 @@ on: # Map the workflow outputs to job outputs. outputs: platform: - description: Platform details. + description: Platform fact output. value: ${{ jobs.platform-linux.outputs.platform || '{}' }} jobs: @@ -111,6 +111,6 @@ jobs: needs: [platform-linux] runs-on: ubuntu-latest steps: - - uses: geekyeggo/delete-artifact@v4 + - uses: geekyeggo/delete-artifact@v5 with: name: ${{ env.ARTIFACT_NAME }} From f00bdf574883727a96fd5f65c0c0bc052dc5dc54 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 23 Apr 2024 23:44:12 +0100 Subject: [PATCH 100/101] Revert "GHA: platform-linux: Adds /etc/ansible/facts.d to the caching path list" This reverts commit 900a45335b912913fdba109d196e5eaf85920914. Refs: --- .github/workflows/platform-linux.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/platform-linux.yml b/.github/workflows/platform-linux.yml index ffff82df..fd89530d 100644 --- a/.github/workflows/platform-linux.yml +++ b/.github/workflows/platform-linux.yml @@ -74,9 +74,7 @@ jobs: if: env.CACHE uses: actions/cache@v4 with: - path: | - /etc/ansible/facts.d - ~/.wine/drive_c + 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 From 0dc9e73486a8fe90e87b540cd865f31f43ec8cff Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 8 Sep 2024 00:14:40 +0100 Subject: [PATCH 101/101] Converts docker-compose to docker compose Refs: https://github.com/actions/runner-images/issues/9692 Refs: https://github.com/orgs/community/discussions/134407 Refs: https://github.blog/changelog/2024-04-10-github-hosted-runner-images-deprecation-notice-docker-compose-v1/ --- .github/workflows/tests-mql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-mql.yml b/.github/workflows/tests-mql.yml index a9122002..9038b099 100644 --- a/.github/workflows/tests-mql.yml +++ b/.github/workflows/tests-mql.yml @@ -45,7 +45,7 @@ jobs: && 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: @@ -69,4 +69,4 @@ jobs: && 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