Files
OpenBB/.github/workflows/api-integration-test.yml
2023-10-03 14:42:39 +01:00

82 lines
2.1 KiB
YAML
Vendored

name: API Integration Tests
on:
push:
branches:
- feature/openbb-sdk-v4
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
api-integration-tests:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- name: Slack Notification - Starting
uses: act10ns/slack@v1
with:
status: starting
channel: '#workflows'
message: Starting Integration Test...
if: always()
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout specific ref
if: github.event_name == 'pull_request'
run: git fetch origin ${{ github.event.pull_request.head.ref }} && git checkout FETCH_HEAD
- name: Setup Python 3.8 with venv
run: |
python -m venv obb-38
source obb-38/bin/activate
- name: Install Poetry and TOML
run: |
pip install poetry toml
- name: Install obb Dependencies
run: |
python openbb_platform/dev_install.py -e
- name: Populate Setting Files
run: |
pwd
touch ~/openbb_platform/user_settings.json
echo '{"log_collect":false}' > ~/openbb_platform/user_settings.json
- name: Launch the Uvicorn Process
run: |
uvicorn openbb_core.api.rest_api:app --host 0.0.0.0 --port 8000 --reload &
- name: Wait for 1 minute
run: |
sleep 60
- name: Run Integration Tests
run: |
pytest -m integration
# - name: Upload summary to Slack
# uses: adrey/slack-file-upload-action@master
# with:
# token: ${{ secrets.SLACK_API_TOKEN }}
# initial_comment: "API Integration test summary"
# title: "Integration test summary"
# path: summary.txt
# channel: ${{ secrets.SLACK_CHANNEL_ID }}
# - name: Slack Notification - Success/Failure
# uses: act10ns/slack@v1
# with:
# status: ${{ job.status }}
# steps: ${{ toJson(steps) }}
# channel: '#workflows'
# if: always()