@@ -38,90 +38,47 @@ jobs:
3838 with :
3939 extra_args : --files ${{ steps.changed-files.outputs.repo_files }}
4040
41- Binance-Exchange-Data :
42- runs-on : ubuntu-latest
43- timeout-minutes : 90
41+
42+ Binance-Backtests :
4443 strategy :
4544 fail-fast : false
45+ matrix :
46+ timerange :
47+ - 20210101-20210201
48+ - 20210201-20210301
49+ - 20210301-20210401
50+ - 20210401-20210501
51+ - 20210601-20210701
52+ opentrades :
53+ - 5
54+ runs-on : ubuntu-latest
4655
4756 steps :
4857 - uses : actions/checkout@v2
49-
50- - name : Backtesting Variables
51- id : dotenv
52- 5358 with :
54- log-variables : true
55- path :
56- user_data/backtesting-binance.env
59+ submodules : true
5760
58- - name : Download Cache
59- continue-on-error : true
60- uses : dawidd6/action-download-artifact@v2
61- with :
62- workflow : tests.yml
63- name : exchange-data-${{ steps.dotenv.outputs.exchange }}
64- path : user_data/data/${{ steps.dotenv.outputs.exchange }}
61+ - name : Build Backtest Image
62+ run : docker-compose build backtesting
6563
66- - name : Download Data
64+ - name : Run Backtest ${{ matrix.opentrades }} trades ${{ matrix.timerange }}
6765 env :
68- START_DATE : ${{ steps.dotenv.outputs.start_date }}
69- END_DATE : ${{ steps.dotenv.outputs.end_date }}
66+ MAX_OPEN_TRADES : ${{ matrix.opentrades }}
67+ STAKE_AMOUNT : unlimited
68+ TIMERANGE : ${{ matrix.timerange }}
7069 EXCHANGE : ${{ steps.dotenv.outputs.exchange }}
71- run : |
72- docker-compose run --rm download-data
70+ run : docker-compose run -T --rm backtesting 1> backtest_${{ matrix.timerange }}_${{ matrix.opentrades }}.txt
71+
72+ - name : Show Backtest ${{ matrix.timerange }} ${{ matrix.opentrades }}
73+ run : cat backtest_${{ matrix.timerange }}_${{ matrix.opentrades }}.txt
7374
74- - name : Upload Cache
75- if : always()
75+ - name : ' Upload Artifact'
7676 uses : actions/upload-artifact@v2
7777 with :
78- name : exchange-data-${{ steps.dotenv.outputs.exchange }}
79- path : user_data/data/${{ steps.dotenv.outputs.exchange }}
80-
81- # Kucoin-Exchange-Data:
82- # runs-on: ubuntu-latest
83- # timeout-minutes: 90
84- # strategy:
85- # fail-fast: false
86- #
87- # steps:
88- # - uses: actions/checkout@v2
89- #
90- # - name: Backtesting Variables
91- # id: dotenv
92- 93- # with:
94- # log-variables: true
95- # path:
96- # user_data/backtesting-kucoin.env
97- #
98- # - name: Download Cache
99- # continue-on-error: true
100- # uses: dawidd6/action-download-artifact@v2
101- # with:
102- # workflow: tests.yml
103- # name: exchange-data-${{ steps.dotenv.outputs.exchange }}
104- # path: user_data/data/${{ steps.dotenv.outputs.exchange }}
105- #
106- # - name: Download Data
107- # env:
108- # START_DATE: ${{ steps.dotenv.outputs.start_date }}
109- # END_DATE: ${{ steps.dotenv.outputs.end_date }}
110- # EXCHANGE: ${{ steps.dotenv.outputs.exchange }}
111- # run: |
112- # docker-compose run --rm download-data
113- #
114- # - name: Upload Cache
115- # if: always()
116- # uses: actions/upload-artifact@v2
117- # with:
118- # name: exchange-data-${{ steps.dotenv.outputs.exchange }}
119- # path: user_data/data/${{ steps.dotenv.outputs.exchange }}
78+ name : backtest_result
79+ path : backtest_${{ matrix.timerange }}_${{ matrix.opentrades }}.txt
12080
121- Binance-Backtests :
122- needs :
123- - Pre-Commit
124- - Binance-Exchange-Data
81+ Kucoin-Backtests :
12582 strategy :
12683 fail-fast : false
12784 matrix :
@@ -137,25 +94,14 @@ jobs:
13794
13895 steps :
13996 - uses : actions/checkout@v2
140-
141- - name : Backtesting Variables
142- id : dotenv
143- 14497 with :
145- log-variables : true
146- path :
147- user_data/backtesting-binance.env
148-
149- - name : Download Data Cache
150- uses : actions/download-artifact@v2
151- with :
152- name : exchange-data-${{ steps.dotenv.outputs.exchange }}
153- path : user_data/data/${{ steps.dotenv.outputs.exchange }}
98+ submodules : true
15499
155100 - name : Build Backtest Image
156101 run : docker-compose build backtesting
157102
158103 - name : Run Backtest ${{ matrix.opentrades }} trades ${{ matrix.timerange }}
104+ continue-on-error : true
159105 env :
160106 MAX_OPEN_TRADES : ${{ matrix.opentrades }}
161107 STAKE_AMOUNT : unlimited
@@ -172,89 +118,49 @@ jobs:
172118 name : backtest_result
173119 path : backtest_${{ matrix.timerange }}_${{ matrix.opentrades }}.txt
174120
175- # Kucoin-Backtests:
176- # needs:
177- # - Pre-Commit
178- # - Kucoin-Exchange-Data
179- # strategy:
180- # fail-fast: false
181- # matrix:
182- # timerange:
183- # - 20210101-20210201
184- # - 20210201-20210301
185- # - 20210301-20210401
186- # - 20210401-20210501
187- # - 20210601-20210701
188- # opentrades:
189- # - 5
190- # runs-on: ubuntu-latest
191- #
192- # steps:
193- # - uses: actions/checkout@v2
194- #
195- # - name: Backtesting Variables
196- # id: dotenv
197- 198- # with:
199- # log-variables: true
200- # path:
201- # user_data/backtesting-kucoin.env
202- #
203- # - name: Download Data Cache
204- # uses: actions/download-artifact@v2
205- # with:
206- # name: exchange-data-${{ steps.dotenv.outputs.exchange }}
207- # path: user_data/data/${{ steps.dotenv.outputs.exchange }}
208- #
209- # - name: Build Backtest Image
210- # run: docker-compose build backtesting
211- #
212- # - name: Run Backtest ${{ matrix.opentrades }} trades ${{ matrix.timerange }}
213- # continue-on-error: true
214- # env:
215- # MAX_OPEN_TRADES: ${{ matrix.opentrades }}
216- # STAKE_AMOUNT: unlimited
217- # TIMERANGE: ${{ matrix.timerange }}
218- # EXCHANGE: ${{ steps.dotenv.outputs.exchange }}
219- # run: docker-compose run -T --rm backtesting 1> backtest_${{ matrix.timerange }}_${{ matrix.opentrades }}.txt
220- #
221- # - name: Show Backtest ${{ matrix.timerange }} ${{ matrix.opentrades }}
222- # run: cat backtest_${{ matrix.timerange }}_${{ matrix.opentrades }}.txt
223- #
224- # - name: 'Upload Artifact'
225- # uses: actions/upload-artifact@v2
226- # with:
227- # name: backtest_result
228- # path: backtest_${{ matrix.timerange }}_${{ matrix.opentrades }}.txt
229-
230- Test :
121+ Binance-Backest-Tests :
231122 runs-on : ubuntu-20.04
232123 needs :
233124 - Pre-Commit
234- - Binance-Exchange-Data
235- # - Kucoin-Exchange-Data
236125
237126 steps :
238127 - uses : actions/checkout@v2
128+ with :
129+ submodules : true
130+
131+ - name : Build Tests Image
132+ run : docker-compose build tests
133+
134+ - name : Run Tests
135+ env :
136+ EXTRA_ARGS : tests/backtests/binance/
137+ run : |
138+ mkdir artifacts
139+ chmod 777 artifacts
140+ docker-compose run --rm tests
239141
240- - name : Backtesting Variables
241- id : dotenv
242- 142+ - name : Upload Artifacts
143+ uses : actions/upload-artifact@v2
243144 with :
244- log-variables : true
245- path :
246- user_data/backtesting-binance.env
145+ name : binance-testrun-artifacts
146+ path : artifacts/
147+
148+ Kucoin-Backest-Tests :
149+ runs-on : ubuntu-20.04
150+ needs :
151+ - Pre-Commit
247152
248- - name : Download Data Cache
249- uses : actions/download-artifact @v2
153+ steps :
154+ - uses : actions/checkout @v2
250155 with :
251- name : exchange-data-${{ steps.dotenv.outputs.exchange }}
252- path : user_data/data/${{ steps.dotenv.outputs.exchange }}
156+ submodules : true
253157
254158 - name : Build Tests Image
255159 run : docker-compose build tests
256160
257161 - name : Run Tests
162+ env :
163+ EXTRA_ARGS : tests/backtests/kucoin/
258164 run : |
259165 mkdir artifacts
260166 chmod 777 artifacts
@@ -263,5 +169,26 @@ jobs:
263169 - name : Upload Artifacts
264170 uses : actions/upload-artifact@v2
265171 with :
266- name : testrun-artifacts
172+ name : kucoin- testrun-artifacts
267173 path : artifacts/
174+
175+ Remaining-Tests :
176+ runs-on : ubuntu-20.04
177+ needs :
178+ - Pre-Commit
179+
180+ steps :
181+ - uses : actions/checkout@v2
182+ with :
183+ submodules : true
184+
185+ - name : Build Tests Image
186+ run : docker-compose build tests
187+
188+ - name : Run Tests
189+ env :
190+ EXTRA_ARGS : --ignore tests/backtests/binance/ --ignore tests/backtests/kucoin/
191+ run : |
192+ mkdir artifacts
193+ chmod 777 artifacts
194+ docker-compose run --rm tests
0 commit comments