fix: Remove duplicate @ prefix in task string representation #33
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: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - '.github/workflows/ci.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - '.github/workflows/ci.yml' | |
| workflow_dispatch: | |
| inputs: | |
| python_version: | |
| description: 'Python version to test' | |
| required: false | |
| default: 'all' | |
| type: choice | |
| options: | |
| - 'all' | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| FORCE_COLOR: 1 | |
| UV_SYSTEM_PYTHON: 1 | |
| jobs: | |
| # Job 1: Lint and type checking | |
| lint: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: 'latest' | |
| enable-cache: true | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/uv | |
| .venv | |
| key: lint-${{ runner.os }}-${{ hashFiles('**/uv.lock') }} | |
| restore-keys: | | |
| lint-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: | | |
| uv sync --frozen --extra dev | |
| - name: Run ruff format check | |
| run: | | |
| echo "π¨ Checking code formatting..." | |
| uv run ruff format --check . | |
| echo "β Format check passed" | |
| - name: Run ruff linting | |
| run: | | |
| echo "π Running linting checks..." | |
| uv run ruff check . | |
| echo "β Linting passed" | |
| - name: Run mypy type checking | |
| continue-on-error: true | |
| run: | | |
| echo "π Running type checking (informational only)..." | |
| uv run mypy src/taskrepo || echo "β οΈ Type checking found issues (non-blocking)" | |
| # Job 2: Test matrix across Python versions | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.python_version != 'all') && fromJson(format('["{0}"]', github.event.inputs.python_version)) || fromJson('["3.10", "3.11", "3.12"]') }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: 'latest' | |
| enable-cache: true | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/uv | |
| .venv | |
| key: test-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }} | |
| restore-keys: | | |
| test-${{ runner.os }}-${{ matrix.python-version }}- | |
| - name: Install dependencies | |
| run: | | |
| uv sync --frozen --extra dev | |
| - name: Run unit tests | |
| run: | | |
| echo "π§ͺ Running unit tests..." | |
| uv run pytest tests/unit -v | |
| echo "β Unit tests passed" | |
| - name: Run integration tests | |
| run: | | |
| echo "π§ͺ Running integration tests..." | |
| # Allow empty test collection (exit code 5) | |
| uv run pytest tests/integration -v || [ $? -eq 5 ] && echo "β Integration tests passed (or no tests found)" | |
| # Job 3: Coverage reporting | |
| coverage: | |
| name: Coverage Report | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: 'latest' | |
| enable-cache: true | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/uv | |
| .venv | |
| key: coverage-${{ runner.os }}-${{ hashFiles('**/uv.lock') }} | |
| restore-keys: | | |
| coverage-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: | | |
| uv sync --frozen --extra dev | |
| - name: Run tests with coverage | |
| run: | | |
| echo "π Running full test suite with coverage..." | |
| uv run pytest tests/ -v --cov=taskrepo --cov-report=term-missing --cov-report=xml | |
| echo "β Coverage report generated" | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage.xml | |
| retention-days: 30 | |
| # Job 4: Build verification | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: 'latest' | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: | | |
| uv sync --frozen --extra dev | |
| - name: Build package | |
| run: | | |
| echo "π¦ Building package..." | |
| uv build | |
| echo "β Package built successfully" | |
| - name: Verify package metadata | |
| run: | | |
| echo "π Verifying package contents..." | |
| ls -lh dist/ | |
| uv run python -m tarfile -l dist/*.tar.gz | |
| echo "β Package verification complete" | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-packages | |
| path: dist/ | |
| retention-days: 7 | |
| # Summary job | |
| ci-summary: | |
| name: CI Summary | |
| runs-on: ubuntu-latest | |
| needs: [lint, test, coverage, build] | |
| if: always() | |
| steps: | |
| - name: Generate summary | |
| run: | | |
| echo "## π CI Pipeline Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY | |
| echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY | |
| echo "| Lint & Type Check | ${{ needs.lint.result == 'success' && 'β Passed' || 'β Failed' }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Tests | ${{ needs.test.result == 'success' && 'β Passed' || 'β Failed' }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Coverage | ${{ needs.coverage.result == 'success' && 'β Passed' || 'β Failed' }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Build | ${{ needs.build.result == 'success' && 'β Passed' || 'β Failed' }} |" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| ALL_PASSED=${{ needs.lint.result == 'success' && needs.test.result == 'success' && needs.coverage.result == 'success' && needs.build.result == 'success' }} | |
| if [[ "$ALL_PASSED" == "true" ]]; then | |
| echo "π **All CI checks passed!**" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "β οΈ **Some CI checks failed - please review the logs above**" >> $GITHUB_STEP_SUMMARY | |
| fi |