Add tests to cover some exception raising #226
Workflow file for this run
This file contains 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: Tests | |
on: [push, pull_request] | |
jobs: | |
tests: | |
env: | |
ENV_NAME: SSINS_tests | |
PYTHON: ${{ matrix.python-version }} | |
OS: ${{ matrix.os }} | |
name: Testing | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
# Adding -l {0} helps ensure conda can be found properly. | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.8, 3.9, "3.10"] | |
steps: | |
- uses: actions/checkout@master | |
with: | |
fetch-depth: 1 | |
- name: Setup Miniconda | |
uses: conda-incubator/[email protected] | |
with: | |
auto-update-conda: true | |
miniconda-version: "latest" | |
python-version: ${{ env.PYTHON }} | |
environment-file: ci/${{ env.ENV_NAME }}.yml | |
activate-environment: ${{ env.ENV_NAME }} | |
- name: Conda Info | |
run: | | |
conda info -a | |
conda list | |
PYVER=`python -c "import sys; print('{:d}.{:d}'.format(sys.version_info.major, sys.version_info.minor))"` | |
if [[ $PYVER != ${{ env.PYTHON }} ]]; then | |
exit 1; | |
fi | |
- name: Install | |
run: | | |
pip install . | |
- name: Run Tests | |
run: | | |
python -m pytest --cov=SSINS --cov-config=.coveragerc --cov-report xml:./coverage.xml --junitxml=test-reports/xunit.xml | |
- name: Doc Tests | |
run: | | |
python -m pytest docs/tutorial.rst | |
- name: Upload Coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: ./coverage.xml | |
verbose: true |