Skip to content

Tests

Tests #341

Workflow file for this run

name: Tests
on:
push:
paths:
- "**.py"
- pyproject.toml
- poetry.lock
- .github/workflows/poetry-constraint.txt
- .github/workflows/env-markers/poetry-install-only-main-test.txt
- .github/workflows/tests.yml
branches:
- main
- "releases/**"
pull_request:
paths:
- "**.py"
- pyproject.toml
- poetry.lock
- .github/workflows/poetry-constraint.txt
- .github/workflows/env-markers/poetry-install-only-main-test.txt
- .github/workflows/tests.yml
branches:
- main
- "releases/**"
workflow_dispatch:
schedule:
- cron: "0 15 * * *" # Daily at 6pm Israel standard time
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
runs-on: ${{ matrix.os }}
env:
PY_COLORS: 1
steps:
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install --pip-args="-c .github/workflows/poetry-constraint.txt" poetry
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: |
poetry.lock
.github/workflows/env-markers/poetry-install-only-main-test.txt
- name: Install dependencies
run: poetry install --only main,test
- name: Run live tests (needing an internet connection)
run: poetry run coverage run -m pytest -m live
- name: Run static tests
if: github.event_name != 'schedule'
run: poetry run coverage run -am pytest -m "not live" --disable-network
- name: Report coverage
if: github.event_name != 'schedule'
run: poetry run coverage report
# The following step will be removed when all the project is covered with tests
- name: Maintain 100% coverage on tested modules
if: github.event_name != 'schedule'
run: |
poetry run coverage report --fail-under 100 \
xil/_currencies.py \
xil/_headers.py \
xil/_df_normalizer.py \
xil/onezero.py \