Skip to content

Commit dfaecd3

Browse files
committed
Matrix test step should be a noop when only doc change is pushed
1 parent 025d0f8 commit dfaecd3

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,23 @@ on:
2929
concurrency: "TfAccTests"
3030

3131
jobs:
32+
should_test:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
run_tests: ${{ steps.filter.outputs.run_tests }}
36+
steps:
37+
- uses: dorny/paths-filter@v2
38+
id: filter
39+
with:
40+
filters: |
41+
run_tests:
42+
- '!CHANGELOG.md'
43+
- '!README.md'
44+
- '!website/**'
3245
# ensure the code builds...
3346
build:
47+
if: needs.should_test.outputs.run_tests == 'true'
48+
needs: should_test
3449
name: Build
3550
runs-on: ubuntu-latest
3651
timeout-minutes: 5
@@ -53,8 +68,9 @@ jobs:
5368
go build -v .
5469
# run acceptance tests in a matrix with Terraform core versions
5570
test:
56-
name: Matrix Test
71+
if: needs.should_test.outputs.run_tests == 'true'
5772
needs: build
73+
name: Matrix Test
5874
runs-on: ubuntu-latest
5975
timeout-minutes: 90
6076
strategy:
@@ -110,3 +126,10 @@ jobs:
110126
# disable go test timeout. We rely on GitHub action timeout.
111127
run: |
112128
go test -timeout 0 -v -cover ./sumologic/
129+
# skip acceptance tests
130+
noop:
131+
if: needs.should_test.outputs.run_tests != 'true'
132+
needs: should_test
133+
runs-on: ubuntu-latest
134+
steps:
135+
- run: echo "Skipping tests because only docs or website files changed."

0 commit comments

Comments
 (0)