-
Notifications
You must be signed in to change notification settings - Fork 44
60 lines (57 loc) · 1.51 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build test
on:
push:
branches:
- develop
- master
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
timeout-minutes: 20
env:
IMAGE_NAME: ib-gateway-docker
steps:
- uses: actions/checkout@master
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ env.IMAGE_NAME }}
- name: Smoke tests container image
run: pytest -x
env:
IB_ACCOUNT: ${{ secrets.IB_ACCOUNT }}
IB_PASSWORD: ${{ secrets.IB_PASSWORD }}
TRADING_MODE: paper
- name: Run ib_insync example
run: |
docker run --rm \
-e IB_ACCOUNT=$IB_ACCOUNT \
-e IB_PASSWORD=$IB_PASSWORD \
-e TRADING_MODE=paper \
-p 4001:4002 \
-d \
$IMAGE_NAME;
sleep 30;
pip install ib_insync pandas;
python examples/ib_insync/scripts/connect_gateway.py;
docker stop $(docker ps -a -q)
env:
IB_ACCOUNT: ${{ secrets.IB_ACCOUNT }}
IB_PASSWORD: ${{ secrets.IB_PASSWORD }}
TRADING_MODE: paper