Add build-test-pkgs and extra-pkgs inputs#20
Merged
stertooy merged 8 commits intogap-actions:mainfrom Mar 24, 2026
Merged
Conversation
Contributor
Author
|
Converting this to draft. Ideally this will be built on top of #22. |
fingolfin
reviewed
Mar 23, 2026
action.yml
Outdated
Comment on lines
+152
to
+163
| if ( IsBound( info.Dependencies.TestPackages ) and ( | ||
| "${{ inputs.build-test-pkgs }}" = "recursive" or | ||
| ( "${{ inputs.build-test-pkgs }}" = "true" and depth = 1 ) | ||
| )) then | ||
| for pkg in info.Dependencies.TestPackages do | ||
| name := LowercaseString( pkg[1] ); | ||
| Print( " - is tested using package '", name, "'\n" ); | ||
| if not name in done then | ||
| AddSet( todo, name ); | ||
| fi; | ||
| od; | ||
| fi; |
Member
There was a problem hiding this comment.
This code is now repeated for the 4th time. How about factoring the bulk out into a helper function AddDeps (better name welcome), which might be called as, say,
Suggested change
| if ( IsBound( info.Dependencies.TestPackages ) and ( | |
| "${{ inputs.build-test-pkgs }}" = "recursive" or | |
| ( "${{ inputs.build-test-pkgs }}" = "true" and depth = 1 ) | |
| )) then | |
| for pkg in info.Dependencies.TestPackages do | |
| name := LowercaseString( pkg[1] ); | |
| Print( " - is tested using package '", name, "'\n" ); | |
| if not name in done then | |
| AddSet( todo, name ); | |
| fi; | |
| od; | |
| fi; | |
| AddDeps( "TestPackages", "${{ inputs.build-test-pkgs }}", "is tested using package" ); |
and that helper might look roughly like this (untested, and indentation ought to be fixed):
Suggested change
| if ( IsBound( info.Dependencies.TestPackages ) and ( | |
| "${{ inputs.build-test-pkgs }}" = "recursive" or | |
| ( "${{ inputs.build-test-pkgs }}" = "true" and depth = 1 ) | |
| )) then | |
| for pkg in info.Dependencies.TestPackages do | |
| name := LowercaseString( pkg[1] ); | |
| Print( " - is tested using package '", name, "'\n" ); | |
| if not name in done then | |
| AddSet( todo, name ); | |
| fi; | |
| od; | |
| fi; | |
| AddDeps := function(field, mode, desc) | |
| if ( IsBound( info.Dependencies.(field) ) and ( | |
| mode = "recursive" or | |
| ( mode = "true" and depth = 1 ) | |
| )) then | |
| for pkg in info.Dependencies.(field) do | |
| name := LowercaseString( pkg[1] ); | |
| Print( " - ", desc, " '", name, "'\n" ); | |
| if not name in done then | |
| AddSet( todo, name ); | |
| fi; | |
| od; | |
| fi; | |
| end; |
fingolfin
approved these changes
Mar 23, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The first input is as suggested in a Slack conversation.
The second input, well, I'm not sure if it's needed - ideally everything would be covered by the other inputs, But it probably doesn't hurt to have either.