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

ci: Refactor JS tests to avoid running so often #5841

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

joncinque
Copy link
Contributor

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:

  • Make JS test scripts build the programs they rely on with build:program
  • Avoid running main program-level workflows if there's just a JS change
  • Add new workflow if there's only a JS change

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.

@joncinque joncinque marked this pull request as ready for review November 14, 2023 22:13
@joncinque
Copy link
Contributor Author

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!

@joncinque joncinque merged commit e333bef into solana-labs:master Nov 15, 2023
42 checks passed
@joncinque joncinque deleted the cijs branch November 15, 2023 00:59
Comment on lines +4 to +29
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'
Copy link
Member

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

Copy link
Contributor Author

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.

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