Skip to content

Health check restored #89

Health check restored

Health check restored #89

Workflow file for this run

name: Build test
on:
push:
paths-ignore:
- "README.md"
- "LICENSE"
- "docker-stack.yml"
- ".github/workflows/deploy-dockerhub.yml"
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:
- name: Checkout
uses: actions/checkout@v4
- 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
run: docker build -t ${{ github.repository }} .
- name: Smoke tests container image
run: pytest -x
env:
IB_ACCOUNT: ${{ secrets.IB_ACCOUNT }}
IB_PASSWORD: ${{ secrets.IB_PASSWORD }}
TRADE_MODE: paper
IMAGE_NAME: ${{ github.repository }}
- name: Run ib_insync example
run: |
docker run --rm \
-e IB_ACCOUNT=$IB_ACCOUNT \
-e IB_PASSWORD=$IB_PASSWORD \
-e TRADE_MODE=$TRADE_MODE \
-p 4002:4001 \
-d \
${{ github.repository }} tail -f /dev/null;
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 }}
TRADE_MODE: paper
IMAGE_NAME: ${{ github.repository }}
# - uses: "google-github-actions/setup-gcloud@v0"
# with:
# version: "290.0.1"
# project_id: ${{ secrets.GCP_PROJECT_ID }}
# service_account_key: ${{ secrets.GCP_SA_KEY }}
# export_default_credentials: true
# - name: Run google cloud example
# run: |
# docker run \
# --env GCP_SECRET=True \
# --env GCP_SECRET_IB_ACCOUNT=$GCP_SECRET_IB_ACCOUNT \
# --env GCP_SECRET_IB_PASSWORD=$GCP_SECRET_IB_PASSWORD \
# --env GCP_SECRET_IB_TRADE_MODE=$GCP_SECRET_IB_TRADE_MODE \
# --env GCP_PROJECT_ID=$GCP_PROJECT_ID \
# -e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/credentials.json \
# -v $GOOGLE_APPLICATION_CREDENTIALS:/tmp/keys/credentials.json:ro \
# -d \
# ${{ github.repository }};
# sleep 30;
# if [ -z "$(docker ps -a -q)" ]; then exit 1; fi
# env:
# GCP_SECRET_IB_ACCOUNT: ${{ secrets.GCP_SECRET_IB_ACCOUNT }}
# GCP_SECRET_IB_PASSWORD: ${{ secrets.GCP_SECRET_IB_PASSWORD }}
# GCP_SECRET_IB_TRADE_MODE: ${{ secrets.GCP_SECRET_IB_TRADE_MODE }}
# GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}