-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Internal] Skip integration tests on docs-only changes #4165
base: main
Are you sure you want to change the base?
Conversation
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Check if all changes are in docs/ directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an action to that does the grep for you.
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
integration_tests_required:
- '**/*'
- '!docs/**'
needs: [changes]
if: '{{ needs.changes.outputs.integration_tests_required == "true" }}'
auto-approve: | ||
if: github.event_name == 'merge_group' | ||
needs: check-integration-test-changes | ||
if: '{{ github.event_name == "merge_group" || env.integration_tests_required == "false" }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this won't work in the merge queue. If the "need" job is skipped, this will be skipped too (even with the "if" condition). You can use always() to ensure it runs. Also, use the output
if: always() && (github.event_name == 'merge_group' || needs.check-integration-test-changes.outputs.integration_tests_required == 'true')
|
||
trigger-tests: | ||
needs: check-integration-test-changes | ||
if: '{{ env.integration_tests_required == "true" }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an output, not an env.
Define the output and set an id for the job
jobs:
changes:
runs-on: ubuntu-latest
outputs: <----
integration_tests_required: ${{ steps.filter.outputs.integration_tests_required }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter <----
with:
filters: |
integration_tests_required:
- '!**/*.md'
Changes
Currently, integration tests run on every PR. This takes a considerable amount of time, up to around an hour and 15 minutes. When a change only affects the
docs/
directory, there is no need to run integration tests, as that directory only includes the public documentation and user guides. Thus, integration tests can be skipped.Tests
make test
run locallydocs/
folderinternal/acceptance