Merge pull request #4196 from vivodi/pt #55
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: Test | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
UV_VERSION: 0.5.22 # renovate: datasource=pypi depName=uv | |
jobs: | |
tests: | |
name: Run Tests | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ] | |
operating-system: [ windows-latest, macos-latest, ubuntu-latest ] | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Install uv and Python | |
uses: astral-sh/setup-uv@b5f58b2abc5763ade55e4e9d0fe52cd1ff7979ca # v5 | |
with: | |
enable-cache: true | |
python-version: ${{ matrix.python-version }} | |
version: ${{ env.UV_VERSION }} | |
- name: Install dependencies | |
run: uv sync --group plugin-test --frozen | |
- name: Test with pytest | |
run: | | |
uv run pytest -n logical --dist loadgroup --junit-xml=test-results.xml | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 | |
with: | |
name: Test Results (Python ${{ matrix.python-version }} ${{ matrix.operating-system }}) | |
path: test-results.xml | |
publish-test-results: | |
name: Publish Tests Results | |
needs: tests | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
# only needed unless run with comment_mode: off | |
pull-requests: write | |
# only needed for private repository | |
contents: read | |
# only needed for private repository | |
issues: read | |
if: always() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
path: artifacts | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2 | |
with: | |
files: artifacts/**/*.xml |