Skip to content

Commit 7cb3da1

Browse files
committed
Add scheduled runs for full test suite
Add a schedule trigger (every 6 hours) to ensure the full test suite runs regularly even when there are no PRs. This complements the incremental PR-based testing by providing a safety net for catching collection renames and other issues. Scheduled and workflow_dispatch runs execute all test types regardless of file changes, while PR and merge_group events continue to use the incremental diff-based approach.
1 parent 67774fb commit 7cb3da1

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
workflow_dispatch:
99
merge_group:
10+
schedule:
11+
- cron: "0 */6 * * *"
1012

1113
permissions:
1214
contents: read
@@ -26,32 +28,41 @@ jobs:
2628
with:
2729
fetch-depth: 0
2830

31+
- name: Determine if this is a scheduled or full run
32+
id: run_type
33+
run: |
34+
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
35+
echo "full_run=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "full_run=false" >> $GITHUB_OUTPUT
38+
fi
39+
2940
- name: Get non-topic and non-collection changed files
3041
id: all
31-
if: matrix.test_type == 'all'
42+
if: matrix.test_type == 'all' && steps.run_type.outputs.full_run != 'true'
3243
run: echo "changed=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -ve '^topics\/' -ve '^collections\/' | xargs)" >> $GITHUB_OUTPUT
3344

3445
- name: Get changed topic files
3546
id: topics
36-
if: matrix.test_type == 'topics'
47+
if: matrix.test_type == 'topics' && steps.run_type.outputs.full_run != 'true'
3748
run: echo "changed=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep ^topics\/ | xargs)" >> $GITHUB_OUTPUT
3849

3950
- name: Get changed collection files
4051
id: collections
41-
if: matrix.test_type == 'collections'
52+
if: matrix.test_type == 'collections' && steps.run_type.outputs.full_run != 'true'
4253
run: echo "changed=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep ^collections\/ | xargs)" >> $GITHUB_OUTPUT
4354

4455
- name: Setup Ruby
45-
if: ${{ steps.topics.outputs.changed || steps.collections.outputs.changed || steps.all.outputs.changed }}
56+
if: ${{ steps.topics.outputs.changed || steps.collections.outputs.changed || steps.all.outputs.changed || steps.run_type.outputs.full_run == 'true' }}
4657
uses: ruby/setup-ruby@80740b3b13bf9857e28854481ca95a84e78a2bdf # v1.284.0
4758
with:
4859
bundler-cache: true
4960

5061
- name: Build and test with Rake
5162
if: |
52-
(matrix.test_type == 'topics' && steps.topics.outputs.changed) ||
53-
(matrix.test_type == 'collections' && steps.collections.outputs.changed) ||
54-
(matrix.test_type == 'all' && steps.all.outputs.changed)
63+
(matrix.test_type == 'topics' && (steps.topics.outputs.changed || steps.run_type.outputs.full_run == 'true')) ||
64+
(matrix.test_type == 'collections' && (steps.collections.outputs.changed || steps.run_type.outputs.full_run == 'true')) ||
65+
(matrix.test_type == 'all' && (steps.all.outputs.changed || steps.run_type.outputs.full_run == 'true'))
5566
run: bundle exec rake ${{ matrix.test_type }}
5667
env:
5768
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)