Skip to content

Testing

Testing #140

Workflow file for this run

name: Testing
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- '*'
schedule:
- cron: "0 0 1 * *"
jobs:
test:
name: Test PVGeo
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install Cython
pip install -r requirements.txt
- name: Install PVGeo
run: pip install -e .[pyproj,omf,discretize]
- name: Run Test Suite
run: |
pytest -v --cov .
codecov --token=8da9d332-1618-450d-8654-09a8ecf3c2dc
deploy:
name: Ship to PyPI
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Build and Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pip install wheel twine
python setup.py sdist bdist_wheel
twine upload --skip-existing dist/*