-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
ci: pre-warm Namespace cache for unit/component-view test shards #30098
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
Merged
+130
−83
Merged
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
49a07cb
reuse js deps in unit tests ci
tommasini b6c1920
Merge branch 'main' into ci/reuse-js-deps-ci
tommasini 8b790cc
reuse setup-node-modules action
tommasini e976af6
ci: simplify prepare-ci-js-deps to use setup-node-modules unmodified
tommasini 29627d5
Merge branch 'main' into ci/reuse-js-deps-ci
tommasini d19f532
permissions for prepare ci js deps
tommasini 2794cba
reuse js deps
tommasini 5765b44
not use gh cache
tommasini 3f2ca41
update comments
tommasini a7b825a
adding gh artifacts for fallback to store js dependencies (compressed…
tommasini 3370b72
if failure we fallback to normal install
tommasini 7c8ed8d
always run yarn install on namespace
tommasini 27c111f
restore original guard, while preserving the ci js deps fallback
tommasini d9e8501
merge main and solve conflicts
tommasini 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 hidden or 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,63 @@ | ||
| name: 'Setup CI JS dependencies' | ||
| description: > | ||
| Mounts the Namespace cache volume (node_modules + .yarn/cache) and runs | ||
| yarn install + yarn setup:github-ci --node only when the volume is cold. | ||
| On non-Namespace runners no cache is available, so install always runs. | ||
|
|
||
| inputs: | ||
| runner_provider: | ||
| description: 'Runner provider. Only `namespace` benefits from cache reuse; anything else falls through to a fresh install + setup.' | ||
| required: false | ||
| default: 'current' | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| # Namespace mounts node_modules / .yarn/cache as a persistent volume scoped | ||
| # to the runner pool, so a warm volume makes the file check below find | ||
| # everything and skip install entirely. Cold (e.g. yarn.lock change in the | ||
| # pool) falls through to install, which then warms the volume for everyone. | ||
| - name: Configure Namespace cache | ||
| if: ${{ inputs.runner_provider == 'namespace' }} | ||
| uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0 # v1 | ||
| with: | ||
| path: | | ||
| ~/.cache/yarn | ||
| .metamask | ||
| node_modules | ||
| .yarn/cache | ||
|
|
||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: ${{ inputs.runner_provider != 'namespace' && 'yarn' || '' }} | ||
|
|
||
| # File-based check is the source of truth: a partial restore (e.g. | ||
| # node_modules present but termsOfUseContent.ts missing) still falls | ||
| # through to install + setup. On non-namespace runners no cache is | ||
| # mounted, so this always evaluates to "needs install". | ||
| - name: Determine if install is needed | ||
| id: check-deps | ||
| shell: bash | ||
| run: | | ||
| if [ -d node_modules ] && [ -f app/util/termsOfUse/termsOfUseContent.ts ]; then | ||
| echo "needs-install=false" >> "$GITHUB_OUTPUT" | ||
| echo "✅ node_modules + setup outputs present; skipping install" | ||
| else | ||
| echo "needs-install=true" >> "$GITHUB_OUTPUT" | ||
| echo "⚠️ node_modules or setup outputs missing; will install + setup" | ||
| fi | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Install Yarn dependencies with retry | ||
| if: ${{ steps.check-deps.outputs.needs-install == 'true' }} | ||
| uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 | ||
| with: | ||
| timeout_minutes: 10 | ||
| max_attempts: 3 | ||
| retry_wait_seconds: 30 | ||
| command: yarn install --immutable | ||
|
|
||
| - name: Run project setup | ||
| if: ${{ steps.check-deps.outputs.needs-install == 'true' }} | ||
| shell: bash | ||
| run: yarn setup:github-ci --node | ||
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.