Feature/mcts transfer optimizer (Refactored) #1268
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: Tests and code quality checks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| pre-commit: | |
| name: Format + lint code | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v10.2.0 | |
| - name: Cache the pre-commit hook environments | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Run pre-commit | |
| run: >- | |
| uv run pre-commit run | |
| --hook-stage manual --all-files --show-diff-on-failure | |
| checks: | |
| name: Run tests for Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} | |
| runs-on: ${{ matrix.runs-on }} | |
| needs: [pre-commit] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12", "3.14"] # test oldest and latest supported versions | |
| runs-on: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v10.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # --locked so a stale uv.lock is a CI failure rather than a silent | |
| # re-resolve. | |
| - name: Install package | |
| run: uv sync --locked | |
| # Coverage and default tests (offline, and without the tests marked `slow`) | |
| - name: Test package | |
| env: | |
| FPL_TEAM_ID: 742663 | |
| run: >- | |
| uv run pytest -ra --cov --cov-report=xml --cov-report=term | |
| --durations=20 | |
| - name: Run the slow tests | |
| env: | |
| FPL_TEAM_ID: 742663 | |
| run: uv run pytest -ra -m slow --durations=20 | |
| - name: Upload coverage report | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.xml | |
| fail_ci_if_error: false |