Repository navigation
refactor: reorganize src/unilab by owner layer #318
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 | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| paths-ignore: | |
| - "LICENSE" | |
| - ".github/CODEOWNERS" | |
| - ".github/ISSUE_TEMPLATE/**" | |
| - ".github/pull_request_template.md" | |
| pull_request_target: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| paths-ignore: | |
| - "LICENSE" | |
| - ".github/CODEOWNERS" | |
| - ".github/ISSUE_TEMPLATE/**" | |
| - ".github/pull_request_template.md" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref_name }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| UV_FROZEN: "1" | |
| jobs: | |
| ruff-lint: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| github.event_name == 'pull_request' && | |
| ( | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| github.event.pull_request.head.ref != 'main' | |
| ) | |
| ) || | |
| ( | |
| github.event_name == 'pull_request_target' && | |
| github.event.pull_request.head.repo.full_name != github.repository && | |
| github.event.pull_request.head.ref == 'main' | |
| ) | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| - name: Install dependencies(only dev group) | |
| run: uv sync --only-group dev | |
| - name: Check | |
| run: uv run --no-sync ruff check --output-format=github . | |
| ruff-format: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| github.event_name == 'pull_request' && | |
| ( | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| github.event.pull_request.head.ref != 'main' | |
| ) | |
| ) || | |
| ( | |
| github.event_name == 'pull_request_target' && | |
| github.event.pull_request.head.repo.full_name != github.repository && | |
| github.event.pull_request.head.ref == 'main' | |
| ) | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| - name: Install dependencies(only dev group) | |
| run: uv sync --only-group dev | |
| - name: Check | |
| run: uv run --no-sync ruff format --check . | |
| mypy: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| github.event_name == 'pull_request' && | |
| ( | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| github.event.pull_request.head.ref != 'main' | |
| ) | |
| ) || | |
| ( | |
| github.event_name == 'pull_request_target' && | |
| github.event.pull_request.head.repo.full_name != github.repository && | |
| github.event.pull_request.head.ref == 'main' | |
| ) | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Check | |
| run: uv run mypy src/unilab | |
| pyright: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| github.event_name == 'pull_request' && | |
| ( | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| github.event.pull_request.head.ref != 'main' | |
| ) | |
| ) || | |
| ( | |
| github.event_name == 'pull_request_target' && | |
| github.event.pull_request.head.repo.full_name != github.repository && | |
| github.event.pull_request.head.ref == 'main' | |
| ) | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Check | |
| run: uv run pyright | |
| test: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| github.event_name == 'pull_request' && | |
| ( | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| github.event.pull_request.head.ref != 'main' | |
| ) | |
| ) || | |
| ( | |
| github.event_name == 'pull_request_target' && | |
| github.event.pull_request.head.repo.full_name != github.repository && | |
| github.event.pull_request.head.ref == 'main' | |
| ) | |
| strategy: | |
| matrix: | |
| os: [ubuntu-slim] | |
| # python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || format('refs/pull/{0}/merge', github.event.pull_request.number) }} | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| with: | |
| # python-version: ${{ matrix.python-version }} | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: uv sync --extra motrix | |
| - name: Test with coverage | |
| run: uv run pytest -m "not slow" --cov=unilab --cov-report markdown-append:$GITHUB_STEP_SUMMARY --cov-fail-under=25 |