8000 Skip tests if not making code changes · activeadmin/activeadmin@c957d3d · GitHub
[go: up one dir, main page]

Skip to content

Commit c957d3d

Browse files
committed
Skip tests if not making code changes
We could write this a few different ways. Fewer paths to specify if we target the paths we know we don't want to run the tests for. The focus here is on the docs and any Markdown files outside that directory (e.g. README.md or PR template in .github).
1 parent 76d1ee5 commit c957d3d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,26 @@ concurrency:
1111
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1212

1313
jobs:
14+
pre_test:
15+
name: Pre-test confirmation
16+
runs-on: ubuntu-latest
17+
outputs:
18+
skip_tests: ${{ steps.changed-files.outputs.only_changed }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: tj-actions/changed-files@v45
22+
id: changed-files
23+
with:
24+
files: |
25+
.github/**
26+
!.github/workflows/ci.yaml
27+
docs/**
28+
**.md
29+
.*.yml
30+
1431
test:
32+
needs: pre_test
33+
if: ${{ needs.pre_test.outputs.skip_tests != 'true' }}
1534
name: test (${{ matrix.ruby }}, ${{ matrix.rails }})
1635
runs-on: ${{ matrix.os }}
1736
timeout-minutes: 15

0 commit comments

Comments
 (0)
0