Skip to content

Commit ac1e4ff

Browse files
committed
Only run tests on relevant file changes
1 parent fa4b745 commit ac1e4ff

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ on:
66
branches: ["main"]
77

88
jobs:
9+
check_files:
10+
name: Detect relevant file changes
11+
runs-on: ubuntu-latest
12+
outputs:
13+
test: ${{ steps.filter.outputs.test }}
14+
15+
steps:
16+
- uses: dorny/paths-filter@v3
17+
id: filter
18+
with:
19+
filters: |
20+
test:
21+
- 'usajobsapi/**'
22+
- 'tests/**'
23+
- 'pyproject.toml'
24+
- '.github/workflows/ci.yaml'
25+
926
lint:
1027
name: Lint Python
1128
runs-on: ubuntu-latest
@@ -18,11 +35,14 @@ jobs:
1835
- uses: ./.github/actions/python-post
1936

2037
test:
38+
if: needs.changes.outputs.test == 'true'
39+
needs: changes
2140
name: Test Python
2241
runs-on: ubuntu-latest
2342

2443
steps:
2544
- uses: actions/checkout@v5
45+
2646
- uses: ./.github/actions/python-init
2747
- name: Run tests
2848
run: uv run pytest --cov=usajobsapi --cov-report=term-missing --cov-report=xml --junitxml=junit.xml tests

0 commit comments

Comments
 (0)