Skip to content

Merge branch 'main' of https://github.com/HzaCode/ChemInformant #263

Merge branch 'main' of https://github.com/HzaCode/ChemInformant

Merge branch 'main' of https://github.com/HzaCode/ChemInformant #263

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev,plot]" pytest-cov coverage-badge mypy types-requests
- name: Verify plotting libraries
run: |
python - <<'PY'
import sys, matplotlib
from PIL import __version__ as PILVER
print("Python", sys.version.split()[0])
print("Pillow", PILVER)
print("matplotlib", matplotlib.__version__)
PY
- name: Run linting with ruff
run: |
ruff check src/ tests/
ruff format --check src/ tests/
- name: Run type checking with mypy
run: mypy src/ChemInformant --ignore-missing-imports --allow-untyped-defs --allow-incomplete-defs --no-strict-optional
- name: Run tests with coverage
env:
PYTHONPATH: ${{ github.workspace }}/src
run: pytest --cov=src/ChemInformant --cov-report=xml -v tests/
- name: Generate coverage badge
run: coverage-badge -o coverage.svg -f
- name: Deploy badge to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
publish_branch: gh-pages
keep_files: true
allow_empty_commit: false
commit_message: "Update coverage badge [skip ci]"