Skip to content
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

Add a test workflow for rust projects #495

Merged
merged 1 commit into from
Jan 7, 2024
Merged

Add a test workflow for rust projects #495

merged 1 commit into from
Jan 7, 2024

Conversation

quesabe
Copy link
Collaborator

@quesabe quesabe commented Jan 2, 2024

Closes PLA-289.

@quesabe quesabe requested a review from gvidon January 2, 2024 15:52
@quesabe quesabe self-assigned this Jan 2, 2024
Copy link

linear bot commented Jan 2, 2024

PLA-289

* Otherwise just use the constructor.
*/
static addToProject(project: GitHubProject, options: WithRustTestWorkflow) {
const hasRustTestWorkflow = options.hasRustTestWorkflow ?? false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quesabe do you think we can move this check to the parent? It doesn't feel right to me to be honest to let a nested construct to decide if it should be enabled in the caller.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the nature of GitHub workflows - only the root/.github folder is picked. Thus all the workflows should be moved to the github on the root project for the workflows to actually work. Moreover it is forced by projen that only the root construct can define the github instance. Thus if we define a workflow in a project that is not the root, the only way for it to work is to look at the parent and set the workflow construct with a reference to the github instance on the parent.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quesabe what I mean is that — can we move the check out of addToProject()? So that the caller evaluates hasRustTestWorkflow and decides if addToProject() should be called?

src/common/github/rust-test-workflow.ts Outdated Show resolved Hide resolved
src/common/github/rust-test-workflow.ts Outdated Show resolved Hide resolved
@quesabe quesabe force-pushed the rust-test-workflow branch from dc49bf8 to cb5aeea Compare January 5, 2024 14:46
@quesabe quesabe force-pushed the rust-test-workflow branch from cb5aeea to 59c79da Compare January 5, 2024 14:47
@quesabe quesabe requested a review from gvidon January 5, 2024 14:49
Copy link
Contributor

@gvidon gvidon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quesabe left a question, but it's not blocking — so merging the PR. Still. have a look at the question please.

@gvidon gvidon merged commit 7107663 into main Jan 7, 2024
7 checks passed
@gvidon gvidon deleted the rust-test-workflow branch January 7, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants