free-claude-code/.github/workflows/tests.yml
Workflow config file is invalid. Please check your config file: yaml: line 36: mapping values are not allowed in this context
Alishahryar1 0d292cd578 ci: enhance type checking in workflow and improve test coverage
- 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.
2026-02-14 23:01:11 -08:00

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)