Skip to content

Commit af6a8fd

Browse files
committed
🤖 Add workflow_dispatch test_filter to CI workflow
_Generated with `cmux`_ Allow manual CI workflow triggers to specify an optional test_filter input that gets passed to both unit and integration test jobs. This enables running specific tests via GitHub Actions UI without requiring a full CI run. The filter works with both bun test and jest since they share compatible syntax for file path patterns (positional args) and test name patterns (-t flag).
1 parent feb4da9 commit af6a8fd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
branches: ["**"]
66
merge_group:
77
workflow_dispatch:
8+
inputs:
9+
test_filter:
10+
description: 'Optional test filter (e.g., "workspace", "tests/file.test.ts", or "-t pattern")'
11+
required: false
12+
type: string
813

914
jobs:
1015
static-check:
@@ -68,7 +73,7 @@ jobs:
6873
- uses: ./.github/actions/setup-cmux
6974

7075
- name: Run tests with coverage
71-
run: bun test --coverage --coverage-reporter=lcov src
76+
run: bun test --coverage --coverage-reporter=lcov ${{ inputs.test_filter || 'src' }}
7277

7378
- name: Upload coverage to Codecov
7479
uses: codecov/codecov-action@v5
@@ -90,7 +95,7 @@ jobs:
9095
- uses: ./.github/actions/setup-cmux
9196

9297
- name: Run integration tests with coverage
93-
run: TEST_INTEGRATION=1 bun x jest --coverage tests
98+
run: TEST_INTEGRATION=1 bun x jest --coverage ${{ inputs.test_filter || 'tests' }}
9499
env:
95100
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
96101
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

0 commit comments

Comments
 (0)