GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — smoke tests: leverage caching by midleman · Pull Request #4665 · posit-dev/positron

Conversation

@midleman

@midleman midleman commented Sep 12, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Intent

Currently it takes ~6 minutes for the yarn install step in the Smoke Tests to run. The goal was to leverage caching to speed this up.

The Result:
Best case scenario, if all dirs have cache hits, this step now takes ~45 seconds.

Before
Screenshot 2024-09-13 at 1 14 31 PM

After
Screenshot 2024-09-13 at 1 15 51 PM

Approach

  1. Before installing dependencies, we first attempt to restore the cache for key directories. (I used this file to identify where the install commands originated so I could target them effectively.)
  2. Yarn then installs the dependencies — this process should be faster if the cache was successfully restored.
  3. Finally, we save the cache if it doesn't already exist.

ℹ️ FYI: There is a cleaner cache action that combines both restore and save steps. However, the "always save" feature doesn't (and likely won't ever) work as intended: actions/cache#1315. We need it to always save because if the tests fail, the job won't save new caches since it's a post-cleanup step.

QA Notes

Both Pull Requests (PRs) and merges to main use the same GitHub workflow to run tests. You can review the performance and results of this run in the PR, which will impact both.

Also, it's important to note about GitHub caching:

Caches are scoped to a key and a branch, so a cache created on branch-A won’t be accessible from branch-B unless branch-A is the default branch.

It’s recommended to have a workflow run on your default branch (e.g., main) so that workflows on other branches can restore caches from it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
midleman added 30 commits September 12, 2024 14:21
@midleman
add yarn cache
52c397c
@midleman
3 caches
55c460c
@midleman
freeze lock file
53b4545
@midleman
bump version
745faf6
@midleman
temp disable all the things
389b91c
@midleman
oops
21f8bf0
@midleman
breakout restore & save
9c0d3f9
@midleman
remove node-gyp for funsies
ca46679
@midleman
add more caching
0d75dfc
@midleman
oops save not restore
2fbfaee
@midleman
dynamic list
cf0fa21
@midleman
space sep
3f55c59
@midleman
new line formatting
402d58a
@midleman
use glob
8b83b5a
@midleman
bust
d6d01b1
@midleman
bust build
299d797
@midleman
typo
241c7da
@midleman
add runner.os
77e6490
@midleman
v2
bf468c0
@midleman
update names
7c7af00
@midleman
add missing os
4ee306c
@midleman
missing dash
b8ff3ba
@midleman
bye felicia
3caa15e
@midleman
minor tweaks
52074b0
@midleman
missing runner.os
9f5a6c4
@midleman
just work
ccc886a
@midleman
temp: skip install
818a606
@midleman
Merge branch 'main' into mi/cache-deps
2ceef1d
@midleman
put things back
7061be8
@midleman
comment node-gyp for now
f026a33
midleman added 5 commits September 13, 2024 12:13
@midleman
extensions dir
b70f82e
@midleman
gyp first?
759e436
@midleman
more paths for extension
6f810ab
@midleman
remove restore-keys
613b6f0
@midleman
gyp back in
9beb9d0
@midleman
midleman force-pushed the mi/cache-deps branch from 60dcf15 to 9beb9d0 Compare September 13, 2024 17:37
midleman added 2 commits September 13, 2024 12:39
@midleman
comment smoke/auto
c8e88d0
@midleman
remove smoke/auto
09e18a5
@midleman midleman changed the title prs: add yarn cache smoke tests: leverage caching Sep 13, 2024
@midleman
double check cache
992a0db
@midleman
midleman marked this pull request as ready for review September 13, 2024 18:16
@midleman
midleman requested review from jmcphers, jonvanausdeln and testlabauto September 13, 2024 19:20
jmcphers
jmcphers approved these changes Sep 13, 2024
View reviewed changes
testlabauto
testlabauto approved these changes Sep 13, 2024
View reviewed changes

@testlabauto testlabauto left a comment

Copy link
Copy Markdown
Contributor

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.

LGTM!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@midleman
midleman merged commit 4fbd3c7 into main Sep 13, 2024
@midleman
midleman deleted the mi/cache-deps branch September 13, 2024 21:04
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@jmcphers jmcphers jmcphers approved these changes
@testlabauto testlabauto testlabauto approved these changes
@jonvanausdeln jonvanausdeln Awaiting requested review from jonvanausdeln

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@midleman @jmcphers @testlabauto
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.