Unit testing #157
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Unit testing | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- release/** | |
pull_request: | |
branches: | |
- main | |
- master | |
- release/** | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup conda | |
uses: s-weigand/setup-conda@v1 | |
with: | |
update-conda: true | |
python-version: ${{ matrix.python-version }} | |
conda-channels: anaconda, conda-forge | |
- name: Install dependencies | |
run: | | |
conda install pip setuptools | |
conda install flake8 pytest-cov | |
conda install -c conda-forge --file requirements.txt --file optional_requirements.txt | |
python -m pip install nrsur7dq2 | |
- name: Install gwmemory | |
run: | | |
pip install . | |
- name: List installed | |
run: | | |
conda list | |
- name: Test with pytest | |
run: | | |
pytest --cov gwmemory -ra --color yes --cov-report=xml --junitxml=pytest.xml | |
- name: Publish coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
files: coverage.xml | |
flags: python${{ matrix.python-version }} | |
- name: Coverage report | |
run: python -m coverage report --show-missing | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pytest-${{ matrix.python-version }} | |
path: pytest.xml |