Polish documentation for v0.1.0 (#18) #84
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: pytest | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
# Run every Monday at 3:42 AM UTC | |
# Note cron-scheduled workflows will get disabled under specific circumstances, see: | |
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule | |
# specifically: | |
# - "If the repository is public and the repository is inactive for 60 days" | |
# - "When the last user to commit to the cron schedule of a workflow is removed from the organization" | |
- cron: '42 03 * * MON' | |
jobs: | |
test: | |
strategy: | |
fail-fast: false # run all matrix jobs even if one fails | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
suffix: [''] # placeholder as an alternative to "-min" | |
include: | |
# run with minimal versions of dependencies just on one matrix job, where the coverage report will only get uploaded | |
- os: ubuntu-latest | |
python-version: "3.8" # update to match lowest supported version | |
suffix: -min | |
runs-on: ${{ matrix.os }} | |
env: | |
# pip-compatible requirements file that specifies the minimal versions of dependencies | |
# to test against. Makes sense only when running with the "-min" suffix. | |
MIN_REQUIREMENTS: ci/requirements-pip-minimal.txt | |
steps: | |
# Check out only a limited depth and then pull tags to save time | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: Get tags | |
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- name: Install Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up test minimal requirements | |
if: matrix.suffix == '-min' | |
# install minimal versions of dependencies in the requirements file first to avoid installing newer versions automatically | |
run: | | |
pip install -r ${{ env.MIN_REQUIREMENTS }} | |
pip freeze | |
- name: Set up tests environment | |
run: | | |
pip install .[test] | |
pip freeze | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
pytest pvpltools --cov=./ --cov-report=xml | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
# only upload coverage report once, for the minimal version of dependencies | |
if: matrix.os == 'ubuntu-latest' && matrix.suffix == '-min' | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |