Skip to content

Commit dcc8cc7

Browse files
authored
Merge branch 'main' into add-update-job
2 parents 00bd71b + ef29d3d commit dcc8cc7

File tree

3 files changed

+90
-3
lines changed

3 files changed

+90
-3
lines changed

.github/workflows/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# GitHub Actions Workflows
2+
3+
This directory contains CI/CD workflows for the DeepWork project. We use GitHub's merge queue for efficient testing.
4+
5+
## Workflow Overview
6+
7+
| Workflow | File | Purpose |
8+
|----------|------|---------|
9+
| **Validate** | `validate.yml` | Linting (ruff) and unit tests |
10+
| **Integration Tests** | `claude-code-test.yml` | Command generation and e2e tests |
11+
| **CLA Assistant** | `cla.yml` | Contributor License Agreement verification |
12+
| **Release** | `release.yml` | PyPI publishing on tags |
13+
14+
## Merge Queue Strategy
15+
16+
We use a skip pattern so the same required checks pass in both PR and merge queue contexts:
17+
18+
| Workflow | On PRs | In Merge Queue |
19+
|----------|--------|----------------|
20+
| **Validate** | Runs | Runs |
21+
| **Integration Tests** | Skipped (passes) | Runs |
22+
| **E2E Tests** | Skipped (passes) | Runs |
23+
| **CLA Check** | Runs | Skipped (passes) |
24+
25+
### How It Works
26+
27+
Jobs/steps use `if: github.event_name == 'merge_group'` conditions to control execution:
28+
29+
```yaml
30+
# Job that only runs in merge queue (skipped on PRs)
31+
jobs:
32+
expensive-tests:
33+
if: github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
34+
...
35+
36+
# Step that skips in merge queue (runs on PRs only)
37+
steps:
38+
- name: CLA Check
39+
if: github.event_name != 'merge_group'
40+
...
41+
```
42+
43+
When a job/step is skipped due to an `if` condition, GitHub treats it as a successful check. This allows:
44+
45+
- **Fast PR feedback**: Only lint + unit tests run on every push
46+
- **Thorough merge validation**: Expensive integration/e2e tests run in merge queue before merging
47+
- **No duplicate CLA checks**: CLA is verified on PRs; no need to re-check in merge queue
48+
49+
### Required Checks Configuration
50+
51+
In GitHub branch protection rules, require these checks:
52+
- `Validate / tests`
53+
- `Claude Code Integration Test / validate-generation`
54+
- `Claude Code Integration Test / claude-code-e2e`
55+
- `CLA Assistant / cla-check`
56+
57+
All checks will pass in both PR and merge queue contexts (either by running or by being skipped).
58+
59+
## Workflow Details
60+
61+
### validate.yml
62+
- **Triggers**: `pull_request`, `merge_group`
63+
- **Jobs**: `tests` - runs ruff format/lint checks and pytest unit tests
64+
- Runs on every PR and in merge queue
65+
66+
### claude-code-test.yml
67+
- **Triggers**: `pull_request`, `merge_group`, `workflow_dispatch`
68+
- **Jobs**:
69+
- `validate-generation`: Tests command generation from fixtures (no API key needed)
70+
- `claude-code-e2e`: Full end-to-end test with Claude Code CLI (requires `ANTHROPIC_API_KEY`)
71+
- Both jobs skip on PRs, run in merge queue and manual dispatch
72+
73+
### cla.yml
74+
- **Triggers**: `pull_request_target`, `issue_comment`, `merge_group`
75+
- **Jobs**: `cla-check` - verifies contributors have signed the CLA
76+
- Runs on PRs, skips in merge queue (CLA already verified)
77+
78+
### release.yml
79+
- **Triggers**: Tags matching `v*`
80+
- **Jobs**: Builds and publishes to PyPI

.github/workflows/cla.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
types: [created]
66
pull_request_target:
77
types: [opened, synchronize]
8+
# Run in merge queue but skip the step (shows as passing check)
9+
merge_group:
810

911
# Explicitly set permissions for the workflow
1012
permissions:
@@ -18,7 +20,7 @@ jobs:
1820
runs-on: ubuntu-latest
1921
steps:
2022
- name: "CLA Assistant"
21-
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
23+
if: github.event_name != 'merge_group' && ((github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target')
2224
uses: contributor-assistant/github-action@v2.6.1
2325
env:
2426
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/claude-code-test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
required: false
1010
default: 'false'
1111
type: boolean
12+
# Run on all PRs (shows as check, but steps skip unless in merge queue)
13+
pull_request:
1214
# Run in the merge queue to validate before merging
1315
merge_group:
1416

@@ -18,9 +20,11 @@ concurrency:
1820
cancel-in-progress: true
1921

2022
jobs:
21-
# Job 1: Validate command generation from fixtures (always runs, no API key needed)
23+
# Job 1: Validate command generation from fixtures (no API key needed)
24+
# Runs on merge_group and workflow_dispatch, skipped on PRs (shows as passing check)
2225
validate-generation:
2326
runs-on: ubuntu-latest
27+
if: github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
2428
steps:
2529
- uses: actions/checkout@v4
2630

@@ -80,10 +84,11 @@ jobs:
8084
8185
# Job 2: Full end-to-end test with Claude Code
8286
# Tests the COMPLETE workflow: define job -> implement -> execute
87+
# Runs on merge_group and workflow_dispatch, skipped on PRs (shows as passing check)
8388
claude-code-e2e:
8489
runs-on: ubuntu-latest
8590
needs: validate-generation
86-
if: github.event_name == 'workflow_dispatch' || github.event_name == 'merge_group'
91+
if: github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
8792
env:
8893
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
8994
steps:

0 commit comments

Comments
 (0)