Skip to content

Introduce coveralls for coverage reports #4

Introduce coveralls for coverage reports

Introduce coveralls for coverage reports #4

Workflow file for this run

name: lint-and-test
on:
pull_request:
paths:
- mfglib
- tests
- docs/source/*.py
- pyproject.toml
- .github/workflows/lint-and-test.yml
jobs:
lint-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ matrix.os }}-${{ matrix.python-version }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Poetry version
run: poetry --version
- name: Install package
run: poetry install
- name: Activate venv
run: source $VENV
- name: Lint (black)
run: poetry run black . --check
- name: Lint (isort)
run: poetry run isort . --check
- name: Lint (ruff)
run: poetry run ruff mfglib tests
- name: Lint (mypy)
run: poetry run mypy
- name: Test (pytest)
run: poetry run pytest
- name: Upload coverage data to coveralls.io
run: poetry run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.os }}-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls.io
needs: lint-and-test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}