-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: Refactor JS tests to avoid running so often #5841
Conversation
Merging this early so that it can be part of the dependabot runs tomorrow and avoid using all of our runners at once. I'll happily integrate any feedback afterwards! |
pull_request: | ||
paths: | ||
- 'libraries/type-length-value/js/**' | ||
- 'memo/js/**' | ||
- 'name-service/js/**' | ||
- 'single-pool/js/**' | ||
- 'stake-pool/js/**' | ||
- 'token/js/**' | ||
- 'token-lending/js/**' | ||
- 'token-metadata/js/**' | ||
- 'token-swap/js/**' | ||
- 'pnpm-lock.yaml' | ||
- '.github/workflows/pull-request-js.yml' | ||
push: | ||
branches: [master] | ||
paths: | ||
- 'libraries/type-length-value/js/**' | ||
- 'memo/js/**' | ||
- 'single-pool/js/**' | ||
- 'stake-pool/js/**' | ||
- 'token/js/**' | ||
- 'token-lending/js/**' | ||
- 'token-metadata/js/**' | ||
- 'token-swap/js/**' | ||
- 'pnpm-lock.yaml' | ||
- '.github/workflows/pull-request-js.yml' |
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.
does this mean that any change to any js lib results in all of them running their tests? seems undesireable
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.
Currently, yes. Ideally we'd want to add a check in the matrix to only run that job if there's a change to the subdir OR the lockfile, but I haven't been able to find how GH actions exposes that at the step-level. Let me know if you find something!
Thankfully, these take max 10 minutes to run, so it seemed like an ok trade-off for now.
Problem
The JS CI that kicks off for any change to pnpm-lock.yaml triggers essentially everything to run, when very often we just need to make sure that the packages build.
Solution
Refactor the CI jobs a bit:
build:program
While I was at it, I killed off the fee-specific token-swap JS tests, since they were more annoying than anything else to manage.
Note: Marking this a draft since it might take some time to get things right in CI.