[MIX] CI timeout + RTD for uv + dissemination contribs #95
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: CI | ||
Check failure on line 1 in .github/workflows/ci.yml
|
||
on: | ||
push: | ||
branches: [develop, release] | ||
pull_request: | ||
branches: [develop, release] | ||
env-spec: &env-spec | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest"] # Remove MacOS (billing + github.com/ThalesGroup/scio/issues/2) | ||
python-version: ["3.12", "3.13"] | ||
runs-on: ${{ matrix.os }} | ||
setup-steps: &setup-steps | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install uv and set python version | ||
uses: astral-sh/setup-uv@v6 | ||
with: | ||
version: "0.8.17" | ||
python-version: ${{ matrix.python-version }} | ||
# ==================================== JOBS ==================================== | ||
jobs: | ||
timeout-minutes: 15 | ||
lint: | ||
name: Lint checks | ||
<<: *env-spec | ||
steps: | ||
- *setup-steps | ||
- name: Run ruff | ||
run: | | ||
uvx -v ruff check | ||
uvx -v ruff format --diff | ||
other: | ||
needs: [lint] | ||
<<: *env-spec | ||
steps: | ||
- *setup-steps | ||
- name: Run mypy | ||
run: | | ||
uv -v run mypy | ||
- name: Build & Install | ||
run: | | ||
uv -v build | ||
uv -v pip install dist/scio_pypi-1.0.0rc3-py3-none-any.whl | ||
- name: Build docs (Posix) | ||
if: matrix.os != 'windows-latest' | ||
env: | ||
SPHINXOPTS: --fail-on-warning | ||
run: | | ||
uv -v run make -C docs | ||
- name: Build docs (Windows) | ||
if: matrix.os == 'windows-latest' | ||
env: | ||
SPHINXOPTS: --fail-on-warning | ||
run: | | ||
uv -v run cmd /c "docs\\make.bat" | ||
- name: Run pytest | ||
id: run-pytest | ||
continue-on-error: true | ||
run: | | ||
uv -v run pytest -vv --cov-report=xml | ||
- name: Upload observed plots on failure | ||
if: ${{ steps.run-pytest.outcome == 'failure' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pytest-observed-${{ matrix.os }}-py${{ matrix.python-version }} | ||
path: test/expected/*/*.observed.* | ||
retention-days: 30 | ||
- name: Fail the job if pytest failed | ||
if: ${{ steps.run-pytest.outcome == 'failure' }} | ||
run: exit 1 | ||
- name: Upload coverage report to Codecov | ||
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
# TEMPORARILY DISABLED (https://github.com/ThalesGroup/scio/issues/9) | ||
# - name: Run pytest with lowest resolution | ||
# id: run-pytest-lowest | ||
# continue-on-error: true | ||
# run: | | ||
# uv -v run --refresh --resolution=lowest pytest -vv | ||
# - name: Upload observed plots on lowest failure | ||
# if: ${{ steps.run-pytest-lowest.outcome == 'failure' }} | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: pytest-lowest-observed-${{ matrix.os }}-py${{ matrix.python-version }} | ||
# path: test/expected/*/*.observed.* | ||
# retention-days: 7 | ||
# - name: Fail the job if pytest lowest failed | ||
# if: ${{ steps.run-pytest-lowest.outcome == 'failure' }} | ||
# run: exit 1 |