Skip to content

Commit 49d4a97

Browse files
authored
🤖 Add workflow_dispatch test_filter to CI workflow (#423)
_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. ## Usage When manually triggering the CI workflow through GitHub Actions UI, you can now specify a `test_filter` input: - **Leave empty**: Run all tests (default behavior) - **File path pattern**: `workspace` or `tests/specific.test.ts` - matches file paths - **Test name pattern**: `-t "pattern"` - filters by test description ## Compatibility Both `bun test` and `jest` support: - File path patterns as positional arguments - `-t` flag for test name pattern matching The filter is applied identically to both unit tests (`bun test`) and integration tests (`jest`).
1 parent feb4da9 commit 49d4a97

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 ${{ github.event.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 ${{ github.event.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)