fix test inconsistencies #652
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: Python tests | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- python/** | |
- .github/workflows/** | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths: | |
- python/** | |
- reports/*.qmd | |
- .github/workflows/** | |
jobs: | |
Tests: | |
runs-on: ${{matrix.os}} | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) | |
name: pdstools (Python ${{ matrix.python-version }}) on ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
exclude: | |
- os: windows-latest | |
python-version: "3.9" | |
- os: windows-latest | |
python-version: "3.10" | |
- os: windows-latest | |
python-version: "3.11" | |
# - os: windows-latest | |
# python-version: "3.12" | |
- os: macOS-latest | |
python-version: "3.9" | |
- os: macOS-latest | |
python-version: "3.10" | |
- os: macOS-latest | |
python-version: "3.11" | |
# - os: macOS-latest | |
# python-version: "3.12" | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for draft PR | |
if: github.event_name == 'pull_request' | |
run: | | |
if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then | |
echo "This is a draft PR, exiting." | |
exit 1 | |
fi | |
continue-on-error: true | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: Enable caching | |
uses: astral-sh/setup-uv@v3 | |
with: | |
enable-cache: true | |
cache-dependency-glob: | | |
**/pyproject.toml | |
- name: Install the project | |
run: uv sync --extra tests | |
- name: Run tests | |
run: uv run pytest --cov=./python/pdstools --cov-report=xml --cov-config=./python/tests/.coveragerc --ignore=python/tests/test_healthcheck.py --ignore=python/tests/test_ADMTrees.py | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false |