mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-04-28 03:20:01 +00:00
- Added a step to fail the CI if any '# type: ignore' comments are found in Python files. - Refactored tests to use mocking for better isolation and reliability. - Updated type hints and casting in several files to improve type safety.
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.head_ref || github.ref_name }}
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v4
|
|
with:
|
|
version: "latest"
|
|
|
|
- name: Set up Python
|
|
run: uv python install 3.14
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --all-extras --dev
|
|
|
|
- name: Run tests
|
|
run: uv run pytest -v --tb=short
|
|
|
|
- name: Type check
|
|
run: uv run ty check
|
|
|
|
- name: Fail on type: ignore (no suppressions allowed)
|
|
run: |
|
|
if grep -rE '# type: ignore|# ty: ignore' --include='*.py' . --exclude-dir=.venv --exclude-dir=.git; then
|
|
echo "::error::type: ignore / ty: ignore comments are not allowed. Fix the underlying type errors instead."
|
|
exit 1
|
|
fi
|
|
exit 0
|
|
|
|
- name: Format
|
|
run: uv run ruff format
|
|
|
|
- name: Commit and push formatting changes
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add -A
|
|
git diff --staged --quiet || (git commit -m "style: apply ruff format" && git push)
|