yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Harsh Aggarwal (NVIDIA)Bring back hooks for auto formatting and ensure build works (#7811)2d775b54d

master
4.2 KiB117 linesraw
1name: ClaudeCode - Slang Assistant
2
3permissions:
4  contents: write
5  pull-requests: write
6  issues: write
7  actions: read
8  id-token: write
9
10on:
11  issue_comment:
12    types: [created]
13  pull_request_review_comment:
14    types: [created]
15  issues:
16    types: [opened, assigned]
17  pull_request_review:
18    types: [submitted]
19
20env:
21  AWS_REGION: ${{ vars.AWS_REGION }}
22  AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }}
23  AWS_SECRET_ACCESS_KEY: ${{ vars.AWS_SECRET_ACCESS_KEY }}
24
25jobs:
26  claude:
27    name: Claude Code Assistant
28    if: |
29      (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
30      (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
31      (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
32      (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude')))
33
34    runs-on: ubuntu-latest
35    timeout-minutes: 360
36
37    # Cancel previous runs on new pushes
38    concurrency:
39      group: claude-${{ github.event.issue.number || github.event.pull_request.number || github.run_id }}
40      cancel-in-progress: true
41
42    steps:
43      # Format setup and environment preparation
44      - name: Checkout repository
45        uses: actions/checkout@v4
46        with:
47          fetch-depth: 0
48          submodules: false
49
50      - name: Checkout of submodules
51        run: git submodule update --init --recursive --depth=1
52
53      - name: Format Setup and Environment Preparation
54        uses: ./.github/actions/format-setup
55
56      # Complete Claude execution with authentication, setup, and execution
57      - name: Run Claude Code
58        id: claude
59        uses: ./.github/actions/claude-code-runner
60        with:
61          # Authentication (these secrets must be configured in your repository)
62          llmgw-id: ${{ secrets.LLMGW_ID }}
63          llmgw-secret: ${{ secrets.LLMGW_SECRET }}
64          llmgw-token-url: ${{ secrets.LLMGW_TOKEN_URL }}
65          github-token-fallback: ${{ secrets.GITHUB_TOKEN }}
66
67          # Repository-specific setup
68          setup-commands: |
69            set -euo pipefail
70            echo "🏗️ Setting up environment dependencies..."
71
72            sudo apt-get update
73            sudo apt-get install -y libx11-dev
74
75            # Configure and build the project
76            cmake --preset default --fresh
77            cmake --workflow --preset debug
78
79            echo "✅ Environment setup completed"
80
81          # Custom instructions for Slang
82          custom-instructions: |
83            ### **Build System Information:**
84            - OS: Ubuntu Linux
85            - Build commands: Configure `cmake --preset default`, Build `cmake --build --preset debug`, Test `./build/Debug/bin/slang-test tests/path/to/test.slang`
86            - Project is pre-built and ready for development tasks
87
88            ### **IMPORTANT: Deep Repository Knowledge & Debugging**
89            **Repository Knowledge Tool**: Use `mcp__deepwiki__ask_question` with repoName "shader-slang/slang" for architectural insights and implementation patterns.
90
91            **Implementation Guidelines:**
92            - Use git history (`git log -S "keyword"`) to find related features but don't spend excessive time
93            - Use deepwiki for expert insights and architectural patterns
94            - Think carefully about the user's request before implementing
95
96            ### **Test-Driven Development - Strongly Encouraged**
97            Write failing tests in `tests/` directory, implement fixes and verify both tests and builds succeed before submitting.
98
99          # MCP configuration for deepwiki
100          mcp-config: |
101            {
102              "mcpServers": {
103                "deepwiki": {
104                  "type": "sse",
105                  "url": "https://mcp.deepwiki.com/sse"
106                }
107              }
108            }
109
110          # Advanced configuration (using repository variables)
111          model: ${{ vars.ANTHROPIC_MODEL }}
112          aws-region: ${{ vars.AWS_REGION }}
113          bedrock-base-url: ${{ vars.ANTHROPIC_BEDROCK_BASE_URL }}
114          small-fast-model: ${{ vars.ANTHROPIC_SMALL_FAST_MODEL }}
115
116          # Additional tools for deepwiki
117          allowed-tools: "Bash,View,GlobTool,GrepTool,BatchTool,Write,mcp__deepwiki__ask_question"