Skip to content

Commit 8f20631

Browse files
committed
Try to only test changed files
1 parent a5133c4 commit 8f20631

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,18 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
17-
17+
with:
18+
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
19+
- name: Get changed files
20+
id: changed-files
21+
run: |
22+
if ${{ github.event_name == 'pull_request' }}; then
23+
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
24+
else
25+
echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
26+
fi
1827
- name: Run tests
1928
run: ./util/github-action-test.sh t
2029
env:
2130
TEST_IMAGE: docker.io/coke/rakudo-docs-test
22-
TEST_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
31+
TEST_FILES: ${{ steps.changed-files.outputs.changed_files }}

0 commit comments

Comments
 (0)