-
Notifications
You must be signed in to change notification settings - Fork 59
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
Feature/workflow support #65
Open
987Nabil
wants to merge
28
commits into
sbt:main
Choose a base branch
from
987Nabil:feature/workflow-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
10c5b24
Fix typo
987Nabil b27937b
Use simple generic workflow for internal workflow compilation
987Nabil f9ba5c6
Merge remote-tracking branch 'upstream/main' into feature/workflow-su…
987Nabil ba3975b
Separate files for Workflow, TriggerEvent and common RenderFunctions
987Nabil 67e746f
Impl. ManualEvents
987Nabil df528f3
Impl. WebhookEvents
987Nabil d827cca
Generate custom workflows
987Nabil c228a3d
Do not use tags for pull request in ci workflow
987Nabil 99c15d6
Docu for custom workflows
987Nabil c6f0a65
Paths for Push and PullRequest events
987Nabil 153bb2d
Make Workflow jobs compile without oses
987Nabil 33d6ee7
Introduce generation targets to adjust which workflows will be generated
987Nabil 0ca4784
Merge remote-tracking branch 'upstream/main' into feature/workflow-su…
987Nabil 132e807
Merge remote-tracking branch 'upstream/main' into feature/workflow-su…
987Nabil 0ca1ced
Fix test expectation for path only rendering of pull request events
987Nabil f7d7603
Fix rendering in case of empty scalas
987Nabil c46d1cb
Support rendering without strategy/matrix
987Nabil 1842373
Merge remote-tracking branch 'upstream/main' into feature/workflow-su…
987Nabil 85702f8
Migrate custom workflows with main changes
987Nabil 9c8bad7
Support for reusable workflows
987Nabil 9fa66df
Check githubWorkflowIncludeClean to generate clean workflow as well
987Nabil fe9cacc
Fix reusable workflow rendering
987Nabil d09b0d7
Make reusable workflow jobs another class
987Nabil a945784
Merge remote-tracking branch 'upstream/main' into feature/workflow-su…
987Nabil 7c90b65
Integrate permissions into the workflow DSL
987Nabil cf4f7ae
Regenerate workflows
987Nabil 2a5dc1f
Adjust test expectations
987Nabil 55e748d
Add GitHub doc links to Workflow DSL
987Nabil 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2020-2021 Daniel Spiewak | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sbtghactions | ||
|
||
987Nabil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/** | ||
* @see https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_run | ||
*/ | ||
sealed trait CheckRunEventType extends EventType | ||
mdedetrich marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
object CheckRunEventType { | ||
case object Created extends CheckRunEventType | ||
case object Rerequested extends CheckRunEventType | ||
case object Completed extends CheckRunEventType | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2020-2021 Daniel Spiewak | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sbtghactions | ||
|
||
987Nabil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/** | ||
* @see https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_run | ||
*/ | ||
sealed trait CheckSuiteEventType extends EventType | ||
mdedetrich marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
object CheckSuiteEventType { | ||
case object Completed extends CheckSuiteEventType | ||
case object Requested extends CheckSuiteEventType | ||
case object Rerequested extends CheckSuiteEventType | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2020-2021 Daniel Spiewak | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sbtghactions | ||
|
||
import sbtghactions.RenderFunctions.SnakeCase | ||
|
||
trait EventType extends Product with Serializable { | ||
def render: String = SnakeCase(productPrefix) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2020-2021 Daniel Spiewak | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sbtghactions | ||
|
||
mdedetrich marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
sealed trait GenerationTarget extends Product with Serializable | ||
|
||
object GenerationTarget { | ||
val all: Set[GenerationTarget] = Set(GenerationTarget.CI, GenerationTarget.Clean, GenerationTarget.Custom) | ||
|
||
case object CI extends GenerationTarget | ||
case object Clean extends GenerationTarget | ||
case object Custom extends GenerationTarget | ||
} |
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
Oops, something went wrong.
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.
What about keys like
githubWorkflowJavaVersions
orgithubWorkflowOSes
? Is this supported (if not I suspect that this may be a case of feature creep but having the ability to interpolate these keys into custom workflows would be useful/beneficial if practical).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.
I don't know what you have in mind, but this is now a very general API. It might be, that there is not even a java version needed for the workflow. Also GitHub has the feature of self hosted runners, that might not have the tags for the oses. So that might be confusing for the user. I guess using this keys should be up to the one defining the Workflows.
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.
So to put it differently, what I had is having the ability to use the
githubWorkflowJavaVersions
/githubWorkflowOSes
values in a customReusableWorkflowJob
. While its definitely true that it doesn't make sense in some cases, at least having access to those values can be useful for certain types of custom workflows which this PR implements as a feature.What I had in mind is adjusting
ReusableWorkflowJob
so that it has the https://github.com/sbt/sbt-github-actions/pull/65/files#diff-535533c663b9848aff0c0b943149d3dd8b126b34aa463e507ada7e6011ce8288R38-R39 so that it has thescalas
andjavas
variables.See https://github.com/sbt/sbt-github-actions/pull/65/files#r1117907905.