fix: Add type ignore comments for mypy compatibility #50
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main, develop ] | |
tags: [ 'v*' ] | |
pull_request: | |
branches: [ main, develop ] | |
workflow_call: | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.13"] | |
include: | |
# Test on additional Python versions on Ubuntu only | |
- os: ubuntu-latest | |
python-version: "3.13" | |
continue-on-error: ${{ matrix.experimental == true }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: | | |
pyproject.toml | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e ".[dev]" | |
- name: Run tests with pytest | |
run: | | |
pytest -v --cov=thegraph_token_api --cov-report=term-missing --cov-report=xml --cov-report=html | |
- name: Upload coverage to Codecov | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | |
uses: codecov/codecov-action@v5 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload coverage reports | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: htmlcov/ | |
- name: Check coverage threshold | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | |
run: | | |
coverage report --fail-under=90 | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e ".[dev]" | |
- name: Run ruff linter | |
run: | | |
ruff check --output-format=github . | |
- name: Run ruff formatter | |
run: | | |
ruff format --check . | |
- name: Run mypy | |
run: | | |
mypy src/thegraph_token_api --ignore-missing-imports | |
- name: Run bandit security scan | |
run: | | |
bandit -r src/ -f txt | |
- name: Run safety dependency check | |
run: | | |
safety check | |
build: | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
cache: 'pip' | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build package | |
run: | | |
python -m build | |
- name: Check dist contents | |
run: | | |
ls -la dist/ | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-packages | |
path: dist/ |