feat(scheduler): register drift metric calculators with MetricsDirectory #575
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: Python Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Cancel in-progress runs when new commits are pushed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # Least-privilege permissions | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Lint with ruff | |
| run: | | |
| uv run ruff check src tests | |
| uv run ruff format --check src tests | |
| type-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - name: Install dependencies | |
| run: uv sync --group dev --group types | |
| - name: Generate protobuf stubs | |
| run: bash scripts/generate_protos.sh | |
| - name: Type check with pyrefly | |
| run: uv run pyrefly check | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true # Python 3.14 is pre-release until Oct 2026 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libmariadb3 libmariadb-dev mariadb-client protobuf-compiler | |
| - name: Install Python dependencies | |
| run: uv sync --all-groups --extra mariadb | |
| - name: Generate protobuf stubs | |
| run: bash scripts/generate_protos.sh | |
| - name: Shutdown Ubuntu MySQL | |
| run: | | |
| sudo service mysql stop || true | |
| sudo service mariadb stop || true | |
| - name: Set up MariaDB | |
| uses: getong/mariadb-action@v1.11 | |
| with: | |
| mysql user: 'trustyai' | |
| mysql password: 'trustyai' # pragma: allowlist secret | |
| mysql root password: '' | |
| mysql database: 'trustyai-database' | |
| - name: Populate Database | |
| run: mariadb -u trustyai --password=trustyai -D trustyai-database -h 127.0.0.1 < tests/resources/legacy_database_dump.sql # pragma: allowlist secret | |
| - name: Run tests with pytest | |
| run: uv run pytest tests/ -v --cov=src --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false |