ci: detect new ib ver #326
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build test | |
on: | |
push: | |
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 | |
- 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 | |
run: docker build -t $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: | |
TRADING_MODE: paper | |
IB_ACCOUNT: ${{ secrets.IB_ACCOUNT }} | |
IB_PASSWORD: ${{ secrets.IB_PASSWORD }} | |