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

PLA-221 Rework PullRequestTest to work with non npm package managers #264

Merged

Conversation

quesabe
Copy link
Collaborator

@quesabe quesabe commented May 15, 2023

Closes PLA-221.

Previous to this PR the test workflow can only operate with npm. In order to make it work with other package managers the following was done:

  • move from npm-run action to a manually composed job with all steps replicating the npm-run action - the function is named setupNode; the node setup is configurable to be capable of working with npm, pnpm and yarn (with the help of projen internals).
  • add arunScriptJob function that sets up a generic workflow job with the setupNode steps and a final command being run afterwards;
  • utilise setupNode for lighthouse audit setup;
  • update the PullRequestTest workflow to use the new functionality;
  • update tests and templates accordingly.

@quesabe quesabe requested review from gvidon and igorosip0v May 15, 2023 07:03
@quesabe quesabe self-assigned this May 15, 2023
@linear
Copy link

linear bot commented May 15, 2023

PLA-221

/**
* Create GitHub workflow job which runs a node.js script with a given setup.
*/
export const runScriptJob = ({
Copy link
Collaborator Author

@quesabe quesabe May 15, 2023

Choose a reason for hiding this comment

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

This jobs completely replicates the npm-run action and adds functionality to work not only with npm, but rather pnpm and yarn.

@gvidon
Copy link
Contributor

gvidon commented May 16, 2023

@quesabe can we release it to *.*.*-canary version? So that @igorosip0v can play with it in real repo?

@quesabe
Copy link
Collaborator Author

quesabe commented May 17, 2023

@quesabe can we release it to *.*.*-canary version? So that @igorosip0v can play with it in real repo?

@gvidon, I guess we can. The workflow we have does not support such a variety, but I can do it manually.

BTW do we expect canaries to be rarely used or not? If we want a long lasting solution for canary releases maybe I should create a branch canary for such releases and configure the workflow... And for now is it ok to release from the PR branch? Otherwise I could set up the canary workflow first and then use it here, but it would slow down the advance with this PR.

Please let me know which path you consider more suitable.

@gvidon
Copy link
Contributor

gvidon commented May 17, 2023

@quesabe for now we don't plan frequent canaries, so lets go with manual solution. Please ping @igorosip0v on Slack when it is published.

Add a run-script-job that sets up a generic workflow capable of working with npm, pnpm and yarn; update the PullRequestTest workflow to use the new jobs; update tests and templates accordingly.
@quesabe quesabe force-pushed the rework-PullRequestTest-to-work-with-non-npm-package-managers branch from 9bb7d71 to 493d5b9 Compare May 25, 2023 18:25
Move the setup steps into a separate function in order to reuse the steps in lighthouse job. Update typings.
@quesabe quesabe force-pushed the rework-PullRequestTest-to-work-with-non-npm-package-managers branch from 493d5b9 to 0aab936 Compare May 26, 2023 07:10
@gvidon gvidon merged commit 9151209 into main May 26, 2023
4 checks passed
@gvidon gvidon deleted the rework-PullRequestTest-to-work-with-non-npm-package-managers branch May 26, 2023 17:00
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.

None yet

3 participants