Skip to content

Update test suite with latest API outputs, bump lockfile deps #26

Update test suite with latest API outputs, bump lockfile deps

Update test suite with latest API outputs, bump lockfile deps #26

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: unittests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [ "3.10", "3.11" ]
fail-fast: true
max-parallel: 1
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up poetry
uses: Gr1N/setup-poetry@v8
- name: Install dependencies
run: poetry install --with test
- name: Test API
env:
COINGLASS_SECRET: ${{ secrets.COINGLASS_SECRET }}
run: |
poetry run coverage run -m unittest tests.test_api -v
- name: Sleep for 60 seconds
run: sleep 60s
shell: bash
- name: Test Indicator Endpoint
env:
COINGLASS_SECRET: ${{ secrets.COINGLASS_SECRET }}
run: |
poetry run coverage run -a -m unittest tests.test_indicator_endpoint -v
- name: Sleep for 60 seconds
run: sleep 60s
shell: bash
- name: Test Index Endpoint
env:
COINGLASS_SECRET: ${{ secrets.COINGLASS_SECRET }}
run: |
poetry run coverage run -a -m unittest tests.test_index_endpoint -v
- name: Test Exceptions
env:
COINGLASS_SECRET: ${{ secrets.COINGLASS_SECRET }}
run: |
poetry run coverage run -a -m unittest tests.test_exceptions -v
poetry run coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
env_vars: PYTHON
fail_ci_if_error: true