Rename commands to skills throughout CI/CD workflows #483
Workflow file for this run
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 Integration Test | |
| on: | |
| # Manual trigger for testing | |
| workflow_dispatch: | |
| inputs: | |
| debug: | |
| description: 'Enable debug logging' | |
| required: false | |
| default: 'false' | |
| type: boolean | |
| # Run on all PRs (shows as check, but steps skip unless in merge queue) | |
| pull_request: | |
| branches: [main] | |
| # Run in the merge queue to validate before merging | |
| merge_group: | |
| branches: [main] | |
| # Ensure only one instance runs at a time per PR/branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| # Minimal permissions for this workflow | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Job 1: Validate skill generation from fixtures (no API key needed) | |
| # Runs on all events, but actual work only happens in merge_group/workflow_dispatch | |
| # This ensures the check name exists for PRs (needed for GitHub's merge queue) | |
| validate-generation: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # For PRs: just pass quickly (actual tests run in merge queue) | |
| - name: Skip on PR | |
| if: github.event_name == 'pull_request' | |
| run: echo "Validation will run in merge queue. Passing for PR." | |
| - uses: actions/checkout@v4 | |
| if: github.event_name != 'pull_request' | |
| - name: Install uv | |
| if: github.event_name != 'pull_request' | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| if: github.event_name != 'pull_request' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| if: github.event_name != 'pull_request' | |
| run: uv sync --extra dev | |
| - name: Run fruits workflow tests | |
| if: github.event_name != 'pull_request' | |
| run: uv run pytest tests/integration/test_fruits_workflow.py -v | |
| - name: Generate skills and validate structure | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| # Create a test environment | |
| mkdir -p test_project/.deepwork/jobs | |
| mkdir -p test_project/.claude # Required for platform detection | |
| cp -r tests/fixtures/jobs/fruits test_project/.deepwork/jobs/ | |
| # Set up git repo in test project | |
| cd test_project | |
| git init | |
| git config user.email "test@test.com" | |
| git config user.name "Test" | |
| echo "# Test" > README.md | |
| git add . && git commit -m "init" | |
| cd .. | |
| # Run deepwork install to set up the project (this also runs sync) | |
| uv run deepwork install --platform claude --path test_project | |
| # Validate generated skills exist | |
| echo "Checking generated skills..." | |
| ls -la test_project/.claude/skills/ | |
| # Verify skill directories and SKILL.md files exist | |
| # Meta-skill for the job itself | |
| test -f test_project/.claude/skills/fruits/SKILL.md || (echo "Missing fruits meta-skill" && exit 1) | |
| # Step skills | |
| test -f test_project/.claude/skills/fruits.identify/SKILL.md || (echo "Missing fruits.identify skill" && exit 1) | |
| test -f test_project/.claude/skills/fruits.classify/SKILL.md || (echo "Missing fruits.classify skill" && exit 1) | |
| # Verify skill content | |
| grep -q "# fruits.identify" test_project/.claude/skills/fruits.identify/SKILL.md | |
| grep -q "raw_items" test_project/.claude/skills/fruits.identify/SKILL.md | |
| grep -q "identified_fruits.md" test_project/.claude/skills/fruits.identify/SKILL.md | |
| grep -q "# fruits.classify" test_project/.claude/skills/fruits.classify/SKILL.md | |
| grep -q "identified_fruits.md" test_project/.claude/skills/fruits.classify/SKILL.md | |
| grep -q "classified_fruits.md" test_project/.claude/skills/fruits.classify/SKILL.md | |
| echo "Skill generation validated successfully!" | |
| # Job 2: Full end-to-end test with Claude Code | |
| # Tests the COMPLETE workflow: define job -> implement -> execute | |
| # Runs on all events, but actual work only happens in merge_group/workflow_dispatch | |
| # This ensures the check name exists for PRs (needed for GitHub's merge queue) | |
| claude-code-e2e: | |
| runs-on: ubuntu-latest | |
| needs: validate-generation | |
| env: | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| steps: | |
| # For PRs: just pass quickly (actual tests run in merge queue) | |
| - name: Skip on PR | |
| if: github.event_name == 'pull_request' | |
| run: echo "E2E tests will run in merge queue. Passing for PR." | |
| - uses: actions/checkout@v4 | |
| if: github.event_name != 'pull_request' | |
| - name: Check for API key | |
| if: github.event_name != 'pull_request' | |
| id: check-key | |
| run: | | |
| if [ -z "$ANTHROPIC_API_KEY" ]; then | |
| echo "has_key=false" >> $GITHUB_OUTPUT | |
| echo "::warning::ANTHROPIC_API_KEY not set, skipping Claude Code e2e test" | |
| else | |
| echo "has_key=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Install Node.js (for Claude Code CLI) | |
| if: steps.check-key.outputs.has_key == 'true' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Claude Code CLI | |
| if: steps.check-key.outputs.has_key == 'true' | |
| run: npm install -g @anthropic-ai/claude-code | |
| - name: Install uv | |
| if: steps.check-key.outputs.has_key == 'true' | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| if: steps.check-key.outputs.has_key == 'true' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install deepwork | |
| if: steps.check-key.outputs.has_key == 'true' | |
| run: uv sync | |
| - name: Set up test project with fruits job | |
| if: steps.check-key.outputs.has_key == 'true' | |
| run: | | |
| # Create test project | |
| mkdir -p test_project/.claude | |
| cd test_project | |
| git init | |
| git config user.email "test@test.com" | |
| git config user.name "Test" | |
| echo "# CI Test Project - DeepWork E2E Test" > README.md | |
| git add . && git commit -m "init" | |
| cd .. | |
| # Install deepwork (this sets up .deepwork/ with standard jobs only) | |
| uv run deepwork install --platform claude --path test_project | |
| # Copy the fruits job fixture into the test project | |
| cp -r tests/fixtures/jobs/fruits test_project/.deepwork/jobs/ | |
| # Run sync to generate the fruits skills | |
| uv run deepwork sync --path test_project | |
| echo "Test project setup complete" | |
| echo "Available skills:" | |
| ls -la test_project/.claude/skills/ | |
| # Verify fruits skills were generated | |
| if [ -f "test_project/.claude/skills/fruits/SKILL.md" ] && \ | |
| [ -f "test_project/.claude/skills/fruits.identify/SKILL.md" ] && \ | |
| [ -f "test_project/.claude/skills/fruits.classify/SKILL.md" ]; then | |
| echo "SUCCESS: Fruits skills generated" | |
| else | |
| echo "ERROR: Fruits skills were not generated" | |
| exit 1 | |
| fi | |
| # Execute the /fruits workflow (runs all steps automatically) | |
| - name: Run /fruits workflow | |
| if: steps.check-key.outputs.has_key == 'true' | |
| working-directory: test_project | |
| timeout-minutes: 10 | |
| run: | | |
| echo "=== Running /fruits workflow with test input ===" | |
| claude --print "/fruits" <<'PROMPT_EOF' | |
| raw_items: apple, car, banana, chair, orange, table, mango, laptop, grape, bicycle | |
| PROMPT_EOF | |
| # Verify both outputs were created | |
| if [ -f "identified_fruits.md" ]; then | |
| echo "SUCCESS: identified_fruits.md created" | |
| echo "--- Output ---" | |
| cat identified_fruits.md | |
| else | |
| echo "ERROR: identified_fruits.md was not created" | |
| exit 1 | |
| fi | |
| if [ -f "classified_fruits.md" ]; then | |
| echo "SUCCESS: classified_fruits.md created" | |
| echo "--- Output ---" | |
| cat classified_fruits.md | |
| else | |
| echo "ERROR: classified_fruits.md was not created" | |
| exit 1 | |
| fi | |
| # Validate the complete workflow output | |
| - name: Validate complete workflow | |
| if: steps.check-key.outputs.has_key == 'true' | |
| working-directory: test_project | |
| run: | | |
| echo "=== Validating complete workflow ===" | |
| # Check identified_fruits.md contains expected fruits | |
| echo "Checking identified_fruits.md..." | |
| grep -qi "apple" identified_fruits.md || (echo "Missing: apple" && exit 1) | |
| grep -qi "banana" identified_fruits.md || (echo "Missing: banana" && exit 1) | |
| grep -qi "orange" identified_fruits.md || (echo "Missing: orange" && exit 1) | |
| grep -qi "mango" identified_fruits.md || (echo "Missing: mango" && exit 1) | |
| grep -qi "grape" identified_fruits.md || (echo "Missing: grape" && exit 1) | |
| echo " ✓ All expected fruits found in identified_fruits.md" | |
| # Check classified_fruits.md has expected structure | |
| echo "Checking classified_fruits.md..." | |
| grep -qi "citrus\|tropical\|pome\|berr" classified_fruits.md || (echo "Missing fruit categories" && exit 1) | |
| echo " ✓ Fruit categories found in classified_fruits.md" | |
| # Verify job structure was created correctly | |
| echo "Checking job structure..." | |
| test -f .deepwork/jobs/fruits/job.yml || (echo "Missing job.yml" && exit 1) | |
| test -f .deepwork/jobs/fruits/steps/identify.md || (echo "Missing identify.md" && exit 1) | |
| test -f .deepwork/jobs/fruits/steps/classify.md || (echo "Missing classify.md" && exit 1) | |
| echo " ✓ Job structure is complete" | |
| echo "" | |
| echo "==========================================" | |
| echo " ALL E2E TESTS PASSED SUCCESSFULLY!" | |
| echo "==========================================" | |
| echo "" | |
| echo "Workflow tested:" | |
| echo " 1. Set up test project with fruits job fixture" | |
| echo " 2. Generated skills with deepwork sync" | |
| echo " 3. /fruits - Executed full workflow (identify + classify)" | |
| echo "" | |
| - name: Upload test artifacts | |
| if: steps.check-key.outputs.has_key == 'true' && always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: claude-code-e2e-outputs | |
| path: | | |
| test_project/.deepwork/jobs/fruits/ | |
| test_project/.claude/skills/fruits*/ | |
| test_project/identified_fruits.md | |
| test_project/classified_fruits.md | |
| retention-days: 7 |