Skip to content

chore: format code

chore: format code #10

Workflow file for this run

name: CI
env:
POETRY_VIRTUALENVS_CREATE: true
on:
push:
branches: [ main, develop ]
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3
- name: Install deps
run: poetry install
- name: Lint
run: poetry run flake8 src/ssspx
- name: Docstring style
run: poetry run pydocstyle src/ssspx
- name: Docstring coverage
run: poetry run docstr-coverage src/ssspx --fail-under 90
- name: Type check
run: poetry run mypy src/ssspx
- name: Security scan
run: poetry run bandit -r src/ssspx -c bandit.yaml --severity-level high
- name: Dependency audit
run: poetry run pip-audit --ignore-vuln PYSEC-2022-42969
- name: Deprecations up-to-date
run: poetry run python tools/check_deprecations.py
- name: Validate citation metadata
run: poetry run cffconvert --validate --infile CITATION.cff
unit:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/pypoetry
C:\\Users\\runneradmin\\AppData\\Local\\pip\\Cache
C:\\Users\\runneradmin\\AppData\\Local\\pypoetry\\Cache
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3
- name: Install deps
run: poetry install
- name: Unit tests
run: poetry run pytest -q --maxfail=1 --disable-warnings --cov=ssspx --cov-report=term-missing -m "not integration"
integration:
runs-on: ubuntu-latest
needs: [lint, unit]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3
- name: Install deps
run: poetry install
- name: Integration tests
run: poetry run pytest -q -m integration
docs:
runs-on: ubuntu-latest
needs: [lint, unit]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3
- name: Install deps
run: poetry install
- name: Build docs
run: poetry run mkdocs build --strict
release:
runs-on: ubuntu-latest
needs: [integration, docs]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3
- name: Install deps
run: poetry install
- name: Build distributions
run: poetry build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run semantic-release publish --skip-build
extras:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}-numpy
restore-keys: |
${{ runner.os }}-poetry-
- uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3
- name: Install with extras
run: poetry install -E numpy-backend
- name: Unit tests with extras
run: poetry run pytest -q --maxfail=1 --disable-warnings -m "not integration"