Skip to content

Added Caching to workflows - #1502

Closed
pxsit wants to merge 2 commits into
cms-dev:mainfrom
pxsit:optimize-gh-workflow
Closed

Added Caching to workflows#1502
pxsit wants to merge 2 commits into
cms-dev:mainfrom
pxsit:optimize-gh-workflow

Conversation

@pxsit

@pxsit pxsit commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Implement Docker layer caching
Instead of rebuilding the entire Docker image from scratch on every commit, the optimized workflow uses actions/cache to save and reuse the layers of your Docker image. On a new commit, Docker will only have to rebuild the layers that have actually changed, while reusing all the previous layers from the cache.

- push
- pull_request
push:
branches: [ main, develop ]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we have a branch called develop?

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.docker-cache

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any particular reason for naming the directory with a dot? Just /tmp/docker-cache would seem more straightforward.

@prandla

prandla commented Aug 6, 2025

Copy link
Copy Markdown
Member

Please explain how this is supposed to be better than #1477. Also, currently the debian test is broken; the "run tests" step rebuilds the ubuntu image and uses that instead.

(note that #1477 wasn't quite negative performance impact, I just deemed it not good enough. If we decide the 45 second win is worth the added complexity it brings then we can still pursue this approach.)

@pxsit pxsit closed this Aug 7, 2025
@pxsit
pxsit deleted the optimize-gh-workflow branch August 7, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants