diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 08864434..ae6f46f1 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -17,13 +17,13 @@ permissions: id-token: write jobs: - build: + pytest: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11'] - poetry-version: [1.5.1] + python-version: ['3.10', '3.12'] + poetry-version: [1.7.1] steps: - uses: actions/checkout@v4 @@ -35,53 +35,32 @@ jobs: uses: abatilo/actions-poetry@v3 with: poetry-version: ${{ matrix.poetry-version }} + - name: Setup a local virtual environment (if no poetry.toml file) + run: | + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + - uses: actions/cache@v4 + name: Define a cache for the virtual environment + with: + path: ./.venv + key: venv-${{ hashFiles('poetry.lock') }}-${{ matrix.python-version }} - name: Install dependencies run: | poetry install - name: Test with pytest run: | make test + mv test-results.xml test-results-${{ matrix.python-version }}.xml # we want to make test-results.xml an artifact - name: Archive test results uses: actions/upload-artifact@v4 with: - name: test-results - path: test-results.xml + name: test-results-${{ matrix.python-version }} + path: test-results-${{ matrix.python-version }}.xml - - name: Publish Test Report - uses: mikepenz/action-junit-report@v4 - if: success() || failure() # always run even if the previous step fails + - name: Test Summary + uses: test-summary/action@v2 with: - annotate_notice: true - check_title_template: '{{SUITE_NAME}} {{TEST_NAME}}' - detailed_summary: true - fail_on_failure: true - include_passed: true - report_paths: '**/test-results.xml' - require_tests: true - summary: true - - - name: Surface failing tests + paths: '**/test-results-*.xml' if: always() - uses: pmeier/pytest-results-action@main - with: - # A list of JUnit XML files, directories containing the former, and - # wildcard - # patterns to process. - # See @actions/glob for supported patterns. - path: test-results.xml - - # Add a summary of the results at the top of the report - # Default: true - summary: true - - # Select which results should be included in the report. - # Follows the same syntax as - # `pytest -r` - # Default: fEX - display-options: fEX - - # Fail the workflow if no JUnit XML was found. - # Default: true - fail-on-empty: true