-
Notifications
You must be signed in to change notification settings - Fork 224
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
CI: Trigger workflows based on changed files #2952
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
42f5f2c
CI: Trigger workflows based on changed files
seisman 28da28d
Merge branch 'main' into workflows/paths
seisman 3c9fbe4
Merge branch 'main' into workflows/paths
seisman 588e997
Update more
seisman e4f4a12
Merge branch 'main' into workflows/paths
seisman b1e5fa8
Disable benchmarks in PRs
seisman afeb94f
Apply suggestions from code review
seisman e67ea6a
Merge branch 'main' into workflows/paths
seisman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,14 @@ name: Publish to PyPI | |
# Only run for pushes to the main branch and releases. | ||
on: | ||
push: | ||
branches: | ||
- main | ||
branches: [ main ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only publish a test release to TestPyPI if there are code changes. |
||
paths: | ||
- 'pygmt/**' | ||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 'Makefile' | ||
- 'MANIFEST.in' | ||
- 'pyproject.toml' | ||
- 'README.rst' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder to change this to 'README.md' once #2928 is done. |
||
- '.github/workflows/publish-to-pypi.yml' | ||
release: | ||
types: | ||
- published | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We need to run benchmarks for changes of test files. The main reasons are: (1) when making changes to a test in a PR, we need to know that the new test is not too slow. (2) when merging the changes into the main branch, benchmarks need to be triggered to update the performance baseline. Otherwise, when benchmarks are triggered in a new PR, we will be surprised to see that the test has a performance change even though the changes in the PR is irrelevant to the test.
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.
Yes, #2945 was a good example of this where we only modified the test files, and that caused a change in performance. But this is a bit of a rare case though. Maybe we only need to run the benchmark on merge into main, but not in the Pull Request itself? I.e. delete L14 but keep L19?
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.
Or just disable the workflow in PR (i.e. remove lines 16-20) and run it via slash command when necessary?
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.
Yeah, let's go with that. Just keep a commented line like
# pull_request:
, so we can manually trigger the benchmark workflow if needed. The slash command can be done in a separate PR.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.
Done in b1e5fa8.