Guard includes in ptp properly #4
This file contains hidden or 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: Run tests | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Cache pip and Poetry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/pip | |
| ~/.cache/pypoetry | |
| key: ${{ runner.os }}-poetry-${{ matrix.python }}-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-poetry-${{ matrix.python }}- | |
| - name: Install Poetry | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install "poetry==1.8.1" | |
| - name: Install project + dev dependencies with Poetry | |
| run: | | |
| # Install into the current Python environment for CI reproducibility | |
| poetry config virtualenvs.create false --local | |
| poetry install --no-interaction --no-ansi --with dev | |
| - name: Run tests | |
| run: | | |
| poetry run pytest -q --junitxml=result.xml | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-report-${{ matrix.os }}-py${{ matrix.python }} | |
| path: result.xml |