Fix statusline rendering in non-git directories #24157
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: [master] | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-submission: | |
| if: github.event.pull_request.draft != true | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| skip: ${{ steps.check.outputs.skip }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check for submission folder | |
| id: check | |
| uses: ./.github/actions/check-impl-context | |
| no-impl-context: | |
| if: github.event.pull_request.draft != true | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Ensure .erk/impl-context/ is not in tree | |
| run: | | |
| if [ -d ".erk/impl-context" ]; then | |
| echo "::error::.erk/impl-context/ must be removed before merging. Run: git rm -rf .erk/impl-context/ && git commit && git push" | |
| exit 1 | |
| fi | |
| # === Style Checks (parallel) === | |
| format: | |
| needs: [check-submission, fix-formatting] | |
| if: github.event.pull_request.draft != true && needs.check-submission.outputs.skip == 'false' && needs.fix-formatting.outputs.pushed != 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-uv | |
| - name: Check Python formatting | |
| run: make format-check | |
| lint: | |
| needs: [check-submission] | |
| if: github.event.pull_request.draft != true && needs.check-submission.outputs.skip == 'false' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-uv | |
| - name: Run ruff linting | |
| run: make lint | |
| fix-formatting: | |
| needs: check-submission | |
| if: github.event.pull_request.draft != true && needs.check-submission.outputs.skip == 'false' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| outputs: | |
| pushed: ${{ steps.commit.outputs.pushed }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Checkout PR branch (not detached HEAD) so we can push fixes | |
| ref: ${{ github.head_ref || github.ref }} | |
| # Use PAT so git push triggers a new CI run on the auto-committed HEAD | |
| token: ${{ secrets.ERK_QUEUE_GH_PAT }} | |
| - uses: ./.github/actions/setup-python-uv | |
| - uses: ./.github/actions/setup-prettier | |
| - name: Sync documentation | |
| run: make docs-fix | |
| - name: Fix Python formatting | |
| run: uv run ruff format | |
| - name: Fix markdown formatting | |
| run: prettier --write '**/*.md' --ignore-path .gitignore | |
| - name: Commit and push if changes | |
| id: commit | |
| run: | | |
| if git diff --quiet; then | |
| echo "No formatting changes needed" | |
| echo "pushed=false" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| # On push to master: fail instead of auto-committing | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| echo "::error::Files need formatting or docs are out of sync" | |
| git diff --stat | |
| echo "pushed=false" >> $GITHUB_OUTPUT | |
| exit 1 | |
| fi | |
| # On fork PRs: fail instead of auto-committing (can't push to fork) | |
| HEAD_REPO="${{ github.event.pull_request.head.repo.full_name }}" | |
| BASE_REPO="${{ github.event.pull_request.base.repo.full_name }}" | |
| if [ "$HEAD_REPO" != "$BASE_REPO" ]; then | |
| echo "::error::Formatting issues found (cannot auto-fix fork PRs)" | |
| echo "pushed=false" >> $GITHUB_OUTPUT | |
| exit 1 | |
| fi | |
| # Auto-fix: commit and push | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add '*.md' '*.py' | |
| git commit -m "Auto-fix formatting (docs-sync + ruff + Prettier)" | |
| git push | |
| echo "pushed=true" >> $GITHUB_OUTPUT | |
| echo "::notice::Auto-fixed formatting and pushed" | |
| docs-check: | |
| needs: [check-submission, fix-formatting] | |
| if: github.event.pull_request.draft != true && needs.check-submission.outputs.skip == 'false' && needs.fix-formatting.outputs.pushed != 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-uv | |
| - uses: ./.github/actions/setup-prettier | |
| - name: Check AGENTS.md standard compliance | |
| run: make md-check | |
| - name: Check agent documentation | |
| run: make docs-check | |
| # === Type/Test Checks (parallel) === | |
| ty: | |
| needs: [check-submission] | |
| if: github.event.pull_request.draft != true && needs.check-submission.outputs.skip == 'false' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-uv | |
| - name: Run ty | |
| run: make ty | |
| unit-tests: | |
| needs: [check-submission] | |
| if: github.event.pull_request.draft != true && needs.check-submission.outputs.skip == 'false' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| fail-fast: false | |
| env: | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-uv | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: ./.github/actions/setup-graphite | |
| - name: Run unit tests | |
| run: make test | |
| integration-tests: | |
| needs: [check-submission] | |
| if: github.event.pull_request.draft != true && needs.check-submission.outputs.skip == 'false' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-uv | |
| - uses: ./.github/actions/setup-graphite | |
| - uses: ./.github/actions/setup-prettier | |
| - name: Run integration tests | |
| run: make test-integration | |
| erk-mcp-tests: | |
| needs: [check-submission] | |
| if: github.event.pull_request.draft != true && needs.check-submission.outputs.skip == 'false' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-uv | |
| - name: Run erk-mcp tests | |
| run: make test-erk-mcp | |
| # === CI Failure Summarization (Haiku) === | |
| ci-summarize: | |
| needs: | |
| [ | |
| format, | |
| lint, | |
| fix-formatting, | |
| docs-check, | |
| ty, | |
| unit-tests, | |
| integration-tests, | |
| erk-mcp-tests, | |
| ] | |
| if: | | |
| vars.CLAUDE_ENABLED != 'false' && | |
| always() && | |
| (github.event_name == 'pull_request') && | |
| (github.event.pull_request.draft != true) && | |
| (needs.format.result == 'failure' || | |
| needs.lint.result == 'failure' || | |
| needs.fix-formatting.result == 'failure' || | |
| needs.docs-check.result == 'failure' || | |
| needs.ty.result == 'failure' || | |
| needs.unit-tests.result == 'failure' || | |
| needs.integration-tests.result == 'failure' || | |
| needs.erk-mcp-tests.result == 'failure') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| actions: read | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-uv | |
| - name: Install erk | |
| run: | | |
| if [ -d "./packages/erk-shared" ]; then | |
| uv tool install --from . --with-editable ./packages/erk-shared erk | |
| else | |
| uv tool install --from . --with erk-shared erk | |
| fi | |
| - uses: ./.github/actions/setup-claude-code | |
| - name: Summarize failures | |
| env: | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GH_TOKEN: ${{ github.token }} | |
| run: erk exec ci-generate-summaries --run-id "${{ github.run_id }}" --pr-number "${{ github.event.pull_request.number }}" |