ci: Revamp CI #2240
Workflow file for this run
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 | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '41 16 * * *' # Every day at 16:41 UTC (to avoid high load at exact hour values). | |
| env: | |
| UV_NO_SYNC: 1 | |
| jobs: | |
| tests: | |
| name: Run tests (py${{ matrix.python-version || '3.14' }}, ${{ matrix.os || 'ubuntu-latest' }}, ${{ matrix.dtype || 'float32' }}, options=[${{ matrix.options == 'none' && '' || (matrix.options || 'full') }}]) | |
| runs-on: ${{ matrix.os || 'ubuntu-latest' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Python version variations | |
| - python-version: '3.10' | |
| - python-version: '3.11' | |
| - python-version: '3.12' | |
| - python-version: '3.13' | |
| - python-version: '3.14' | |
| # OS variations | |
| - os: macOS-latest | |
| - os: windows-latest | |
| # dtype variations | |
| - dtype: float64 | |
| # Installation options variations | |
| - options: none | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-uv | |
| with: | |
| python-version: ${{ matrix.python-version || '3.14' }} | |
| - uses: ./.github/actions/install-deps | |
| with: | |
| options: ${{ matrix.options == 'none' && '' || (matrix.options || 'full') }} | |
| groups: test | |
| - name: Run tests | |
| run: uv run pytest -W error tests/unit tests/doc --cov=src --cov-report=xml | |
| env: | |
| PYTEST_TORCH_DTYPE: ${{ matrix.dtype || 'float32' }} | |
| - &upload-codecov | |
| name: Upload results to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| build-doc: | |
| name: Build doc | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-uv | |
| - uses: ./.github/actions/install-deps | |
| with: | |
| options: full | |
| groups: doc | |
| - name: Build Documentation | |
| working-directory: docs | |
| run: uv run make dirhtml | |
| mypy: | |
| name: Run mypy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-uv | |
| - uses: ./.github/actions/install-deps | |
| with: | |
| options: full | |
| groups: check | |
| - name: Run mypy | |
| run: uv run mypy src/torchjd |