Skip to content

Fix coverage

Fix coverage #347

Workflow file for this run

---
name: Test
on:
pull_request:
push:
branches:
- master
- dev1
- "!gh-pages"
env:
IS_CI: "true"
jobs:
bundled:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"] # NB: also see versions for 'conda'
jobtype: ["test"]
include:
- os: "ubuntu-latest"
python-version: "3.10"
jobtype: "lint"
- os: "ubuntu-latest"
python-version: "3.10"
jobtype: "coverage"
- os: "macos-latest"
python-version: "3.10"
jobtype: "test"
env:
JOBTYPE: ${{ matrix.jobtype }}
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: "setup.py"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
pip install coveralls
- name: Run tests
run: |
if [[ "$JOBTYPE" == "lint" ]]; then
# Run flake8 via pre-commit instead.
#- flake8 . # Use --exit-zero to ignore failure
pre-commit install
pre-commit run --all-files
elif [[ "$JOBTYPE" == "coverage" ]]; then
pytest tests --ignore=dapper/mods/QG --cov=dapper --cov-report term-missing
else
pytest tests
fi
- name: Publish coverage to coveralls.io
if: ${{ env.JOBTYPE == coverage }}

Check failure on line 64 in .github/workflows/tests.yml

View workflow run for this annotation

GitHub Actions / Test

Invalid workflow file

The workflow is not valid. .github/workflows/tests.yml (Line: 64, Col: 13): Unrecognized named-value: 'coverage'. Located at position 16 within expression: env.JOBTYPE == coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
conda:
defaults:
run:
shell: bash -el {0}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.12"]
include:
- os: "macos-latest"
python-version: "3.12"
- os: "windows-latest"
python-version: "3.12"
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e .[dev]
- name: Run tests
run: |
which python
pytest tests