Files
EOS/.github/workflows/pytest.yml
T
NormannandGitHub 9b3f37e172 test: clean up git and artifact warnings (#1244)
* initialize the temporary Git repository in test_workflow_git with --initial-branch=main
* avoid Git's default-branch advisory in pytest logs without changing global Git configuration or suppressing stderr
* upload generated optimization result artifacts only when the test job fails
* use the actual nested tests/testdata/**/new_optimize_result* paths
* ignore the no-files case so unrelated test failures do not produce an artifact warning
2026-08-22 00:09:22 +02:00

44 lines
924 B
YAML

name: Run Pytest on Pull Request
permissions:
contents: read
on:
pull_request:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.13.15"
- name: Install uv
run: |
python -m pip install --upgrade pip
pip install uv
- name: Sync environment with uv
run: |
uv sync --extra dev
- name: Run tests
run: |
uv run pytest --finalize --check-config-side-effect -vs --cov src --cov-report term-missing
- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v7
with:
name: optimize-results
path: tests/testdata/**/new_optimize_result*
if-no-files-found: ignore