mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-06-02 06:13:46 +02:00
Make ci parallel
This commit is contained in:
+50
-11
@@ -1,3 +1,6 @@
|
|||||||
|
# Branch protection: require the status check named "ci" (this workflow's gate job).
|
||||||
|
# That single job reflects success or failure of all parallel lanes below.
|
||||||
|
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -11,7 +14,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
checks:
|
no-type-ignore-suppressions:
|
||||||
|
name: Ban type ignore suppressions
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
permissions:
|
permissions:
|
||||||
@@ -31,6 +35,31 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
quality:
|
||||||
|
name: ${{ matrix.id }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- id: ruff-format
|
||||||
|
run: uv run ruff format --check
|
||||||
|
- id: ruff-check
|
||||||
|
run: uv run ruff check
|
||||||
|
- id: ty
|
||||||
|
run: uv run ty check
|
||||||
|
- id: pytest
|
||||||
|
run: uv run pytest -v --tb=short
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
||||||
|
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
|
||||||
with:
|
with:
|
||||||
@@ -38,14 +67,24 @@ jobs:
|
|||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-python: true
|
cache-python: true
|
||||||
|
|
||||||
- name: Format check
|
- name: Run
|
||||||
run: uv run ruff format --check
|
run: ${{ matrix.run }}
|
||||||
|
|
||||||
- name: Style check
|
ci:
|
||||||
run: uv run ruff check
|
name: ci
|
||||||
|
runs-on: ubuntu-latest
|
||||||
- name: Type check
|
timeout-minutes: 5
|
||||||
run: uv run ty check
|
needs: [no-type-ignore-suppressions, quality]
|
||||||
|
if: always()
|
||||||
- name: Run tests
|
permissions:
|
||||||
run: uv run pytest -v --tb=short
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: All checks passed
|
||||||
|
run: |
|
||||||
|
sup="${{ needs.no-type-ignore-suppressions.result }}"
|
||||||
|
qual="${{ needs.quality.result }}"
|
||||||
|
if [[ "$sup" != "success" || "$qual" != "success" ]]; then
|
||||||
|
echo "::error::Required check failed (suppressions: $sup, quality matrix: $qual)."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "All checks passed."
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
- Add tests for new changes (including edge cases), then run `uv run pytest`.
|
- Add tests for new changes (including edge cases), then run `uv run pytest`.
|
||||||
- Run checks in this order: `uv run ruff format`, `uv run ruff check`, `uv run ty check`, `uv run pytest`.
|
- Run checks in this order: `uv run ruff format`, `uv run ruff check`, `uv run ty check`, `uv run pytest`.
|
||||||
- Do not add `# type: ignore` or `# ty: ignore`; fix the underlying type issue.
|
- Do not add `# type: ignore` or `# ty: ignore`; fix the underlying type issue.
|
||||||
- All 5 checks are enforced in `tests.yml` on push/merge.
|
- All 5 checks are enforced in `tests.yml` on push/merge (parallel jobs; a single **ci** gate job aggregates results).
|
||||||
|
- Branch protection: set **required status checks** to **ci** (the gate job name in Actions). If you still require the old single job name, add **ci** and remove obsolete entries after merging this workflow.
|
||||||
|
|
||||||
## IDENTITY & CONTEXT
|
## IDENTITY & CONTEXT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user