CI tests fix + add Publishing CI #3
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 | |
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: | |
- os: ubuntu-latest | |
python-version: "3.8" | |
suffix: -min | |
runs-on: ${{ matrix.os }} | |
env: | |
# Dev requirement filename, e.g., ci/requirements-py3.9-min.txt or ci/requirements-py3.9.txt | |
# these are pip-compatible requirements files | |
REQUIREMENTS: ci/requirements-py${{ matrix.python-version }}${{ matrix.suffix }}.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 }}${{ matrix.suffix }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up test requirements | |
# sets versions of dependencies in the requirements file first to avoid installing newer versions | |
run: | | |
pip install -r ${{ env.REQUIREMENTS }} | |
pip freeze | |
- name: Set up environment | |
run: | | |
pip install .[test] | |
pip freeze | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
pytest pvpltools/test |