Skip to content

Commit f6e916c

Browse files
authored
tests: fix django-google-spanner action trigger (#16823)
As of #16624, `django-google-spanner` presubmits are being triggered on every PR, regardless of whether `django-google-spanner` was changed. We should only trigger presubmit tests when there are changes to `django-google-spanner` or the action itself. See #16812 (comment)
1 parent fcb4579 commit f6e916c

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/django-spanner-django5.2_tests.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
11
on:
2+
pull_request:
3+
paths:
4+
- 'packages/django-google-spanner/**'
5+
- '.github/workflows/django-spanner-django5.2_tests.yml'
26
push:
37
branches:
48
- main
5-
pull_request:
9+
paths:
10+
- 'packages/django-google-spanner/**'
11+
- '.github/workflows/django-spanner-django5.2_tests.yml'
12+
13+
defaults:
14+
run:
15+
working-directory: packages/django-google-spanner
16+
617
name: django-spanner-django5.2-tests
718
jobs:
19+
check_changes:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
run_django_spanner: ${{ steps.filter.outputs.django_spanner }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: dorny/paths-filter@v3
26+
id: filter
27+
with:
28+
filters: |
29+
django_spanner:
30+
- 'packages/django-google-spanner/**'
31+
- '.github/workflows/django-spanner-django5.2_tests.yml'
32+
833
system-tests:
34+
needs: check_changes
35+
if: ${{ needs.check_changes.outputs.run_django_spanner == 'true' }}
936
runs-on: ubuntu-latest
1037
strategy:
1138
fail-fast: false
@@ -47,7 +74,6 @@ jobs:
4774
with:
4875
python-version: "3.10"
4976
- name: Run Django tests
50-
working-directory: packages/django-google-spanner
5177
run: sh django_test_suite_5.2.sh
5278
env:
5379
SPANNER_EMULATOR_HOST: localhost:9010

0 commit comments

Comments
 (0)