Dev container: increase caches of to avoid recompilation? #161
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: Claude Code | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| # We need consistent env vars across all workflows for the cache to work | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CLICOLOR_FORCE: 1 | |
| RUSTFLAGS: "-C debuginfo=0" | |
| RUSTDOCFLAGS: "-Dwarnings" | |
| jobs: | |
| claude: | |
| # Only run when comment contains @claude | |
| if: | | |
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || | |
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Allow pushing commits | |
| pull-requests: write # Allow commenting and updating PRs | |
| issues: write # Allow commenting on issues | |
| id-token: write | |
| actions: read # Required for Claude to read CI results on PRs | |
| steps: | |
| - name: 📂 Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| # Fix: Checkout PR branch for issue_comment events instead of default branch | |
| ref: | |
| ${{ github.event.issue.pull_request && format('refs/pull/{0}/head', | |
| github.event.issue.number) || github.ref }} | |
| fetch-depth: 0 # Get more history for better context | |
| fetch-tags: true | |
| - name: 🔧 Configure git for Claude | |
| run: | | |
| git config --global user.name "Claude Code" | |
| git config --global user.email "[email protected]" | |
| # Install essential tools for the PRQL project | |
| - name: 🔧 Setup Task | |
| uses: go-task/setup-task@v1 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| # Rust is pre-installed on ubuntu-latest, but we ensure consistent toolchain | |
| - uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-insta | |
| - uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-nextest | |
| - run: ./.github/workflows/scripts/set_version.sh | |
| shell: bash | |
| - name: 💰 Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: ${{ hashFiles('./Cargo.lock') }} | |
| shared-key: rust-x86_64-unknown-linux-gnu | |
| save-if: false | |
| - name: 🤖 Run Claude Code | |
| id: claude | |
| uses: anthropics/claude-code-action@v1 | |
| with: | |
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| show_full_output: true | |
| # This is an optional setting that allows Claude to read CI results on PRs | |
| additional_permissions: | | |
| actions: read | |
| # Grant Claude full permissions to execute commands | |
| # Also include system prompt with project context via claude_args | |
| # Note: System prompt must be a single line with \n escapes to avoid argument parsing issues | |
| claude_args: | | |
| --model opus | |
| --allowedTools Bash,Edit,Read,Write,Glob,Grep,WebSearch,WebFetch | |
| --system-prompt "You are helping with the PRQL project in a GitHub Actions environment.\n\nFollow the project guidelines in CLAUDE.md.\nAfter making changes, ensure tests pass with 'task test-all' and lints with 'task lint'.\n\nFor CI failure diagnosis:\n- Use 'gh run list' and 'gh run view' to check CI status\n- Look for specific error messages in failing jobs\n- Check the test output for detailed failure information\n- When fixing issues, verify changes with the appropriate test commands\n- Once local test commands work, push to the PR\n- Then: iterate between monitoring CI, fixing any remaining issues, monitoring CI\n- Don't return until we're confident that we've done everything we can" |