From b34e3da239d13c836e805c7f8ffb80f7544601b9 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Feb 2024 22:25:30 +0000 Subject: [PATCH] Converts action to composite --- .github/workflows/docker.yml | 18 ------------- Dockerfile | 9 ------- action.yml | 51 +++++++++++------------------------- ansible/run-test.yml | 24 +++++++++++++++++ 4 files changed, 40 insertions(+), 62 deletions(-) delete mode 100644 .github/workflows/docker.yml delete mode 100644 Dockerfile create mode 100644 ansible/run-test.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 41e23d9..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Docker - -on: - pull_request: - paths-ignore: - - '**/*.md' - push: - paths-ignore: - - '**/*.md' - -jobs: - Build-Dockerfile: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build Dockerfile - run: docker build . diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 5513577..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM ea31337/ea-tester:dev - -RUN set - -# Copies your code file from your action repository to the filesystem of the container. -COPY entrypoint.sh /entrypoint.sh - -# Executes `entrypoint.sh` when the Docker container starts up. -ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml index dbe9c99..bec9e5c 100644 --- a/action.yml +++ b/action.yml @@ -94,38 +94,19 @@ name: EA Tester # foo: # id of output # description: 'Foo' runs: - using: docker - image: Dockerfile - env: - BT_CURRENCY: ${{ inputs.BtCurrency }} - BT_DAYS: ${{ inputs.BtDays }} - BT_DEPOSIT: ${{ inputs.BtDeposit }} - BT_DEST: ${{ inputs.BtDest }} - BT_DIGITS: ${{ inputs.BtDigits }} - BT_MONTHS: ${{ inputs.BtMonths }} - BT_PERIOD: ${{ inputs.TestPeriod }} - BT_SPREAD: ${{ inputs.BtSpread }} - BT_SYMBOL: ${{ inputs.BtPair }} - BT_TESTMODEL: ${{ inputs.BtTestModel }} - BT_YEARS: ${{ inputs.BtYears }} - GITHUB_API_TOKEN: ${{ inputs.GitHubApiToken }} - EA_OPTS: ${{ inputs.TestLimitOpts }} - OPT_FORMAT_BRIEF: ${{ inputs.OptFormatBrief }} - OPT_FORMAT_JSON: ${{ inputs.OptFormatJson }} - OPT_OPTIMIZATION: ${{ inputs.OptOptimize }} - OPT_TRACE: ${{ inputs.OptTrace }} - OPT_VERBOSE: ${{ inputs.OptVerbose }} - RUN_ON_ERROR: ${{ inputs.RunOnError }} - RUN_ON_EXIT: ${{ inputs.RunOnExit }} - RUN_ON_FAIL: ${{ inputs.RunOnFail }} - RUN_ON_SET: ${{ inputs.RunOnSet }} - RUN_ON_START: ${{ inputs.RunOnStart }} - RUN_ON_SUCCESS: ${{ inputs.RunOnSuccess }} - RUN_ON_WARN: ${{ inputs.RunOnWarning }} - SCRIPT: ${{ inputs.Script }} - SETFILE: ${{ inputs.SetFile }} - SET_OPTS: ${{ inputs.SetOpts }} - SET_PARAMS: ${{ inputs.SetParams }} - TEST_EXPERT: ${{ inputs.TestExpert }} - TEST_REPORT_NAME: ${{ inputs.TestReportName }} - WORKDIR: /github/workspace + steps: + - name: Runs playbook + uses: dawidd6/action-ansible-playbook@v2 + with: + configuration: | + [defaults] + nocows = false + stdout_callback = yaml + directory: ansible + options: | + --connection local + --inventory localhost, + --verbose + playbook: run-test.yml + # requirements: galaxy-requirements.yml + using: composite diff --git a/ansible/run-test.yml b/ansible/run-test.yml new file mode 100644 index 0000000..39edf6c --- /dev/null +++ b/ansible/run-test.yml @@ -0,0 +1,24 @@ +--- +- name: Run test + hosts: all + tasks: + - name: Include main role + ansible.builtin.import_role: + name: ea31337.mt_runner + vars: + mt_runner_bt_mt5_config: + Common: + Server: MetaQuotes-Demo + Tester: + Deposit: 10000 + ExecutionMode: 0 + Expert: Advisors\Dummy.ex5 + FromDate: 2024.01.01 + Leverage: 1:500 + Login: 12345 + Model: 1 + Report: report.html + ReplaceReport: 1 + ShutdownTerminal: 1 + Symbol: EURUSD + ToDate: 2024.01.11