Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 50 additions & 23 deletions .github/workflows/lint_build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,18 @@ concurrency:
cancel-in-progress: ${{ github.event.pull_request.number != null }}

jobs:
build_lint_test:
lint:
if: ${{ github.event.pull_request.draft != true }}
runs-on: ubuntu-latest
strategy:
matrix:
# Support all LTS versions of Python
python-version: [
"3.10",
"3.11",
"3.12",
"3.13"
]
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
with:
python-version: ${{ matrix.python-version }}

- name: Check uv lock
run: |
uv lock --check
python-version: "3.12"
enable-cache: true

# Install
- name: Install Dependencies
Expand All @@ -60,37 +48,76 @@ jobs:
run: |
uv run ruff format . --check

# Mypy
- name: Check uv lock
run: |
uv lock --check

test:
if: ${{ github.event.pull_request.draft != true }}
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
# Support all LTS versions of Python
python-version: [
"3.10",
"3.11",
"3.12",
"3.13"
]
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

# Install
- name: Install Dependencies
run: |
uv sync --frozen --all-extras --group dev

- name: Mypy Check
run: |
uv run mypy .
uv run mypy --python-version ${{ matrix.python-version }} .

# PyTest
- name: Tests
run: |
uv run pytest --cov=mistral_common . --cov-report "xml:coverage.xml"


# Save coverage report as artifact so it's not discarded after the job ends
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: coverage.xml

# Doctests
- name: Doctests
run: |
uv run pytest --doctest-modules ./src

build_docs:
if: ${{ github.event.pull_request.draft != true }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
with:
python-version: "3.12"

enable-cache: true

- name: Install Dependencies
run: |
uv sync --frozen --all-extras --group docs

- name: Build Docs
run: |
uv run mkdocs build --strict
uv run mkdocs build --strict