Skip to content

Tests

Tests #289

Workflow file for this run

name: Tests
on:
schedule:
- cron: "0 8 * * 1-5"
push:
pull_request:
workflow_dispatch:
concurrency:
group: actions-id-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Check Formatting
runs-on: ubuntu-latest
steps:
# clone the repo, run black and flake8 on it
- uses: actions/checkout@v4
- run: python -m pip install black==23.* flake8 isort
- run: black --check .
- run: isort --check .
build-and-test:
name: ${{ matrix.os }} Python ${{ matrix.python-version }} Subtest
runs-on: ${{ matrix.os }}
needs: lint
# run in conda env
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@main
with:
environment-name: temp
condarc: |
channels:
- defaults
- conda-forge
channel_priority: flexible
create-args: |
python=${{ matrix.python-version }}
- name: Install
run: |
pip install coveralls dataclasses
pip install .[test]
- name: Tests
run: |
pytest --cov --pyargs chemplot
- name: Upload coverage data to coveralls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: coveralls --service=github