-
Notifications
You must be signed in to change notification settings - Fork 44
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 enhancement: docker workflow speedup #2232
Merged
+37
−25
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
20bd028
bump actions
aradwann 9f431d0
debug sccache
aradwann 6f1bf40
remove cache mount from dockerfile
aradwann 2e75a7c
clean up commented actions
aradwann e3ee24e
restore sccache mounting
aradwann 7f25fbf
bump mozilla-actions/sccache-action
aradwann 2188742
comply to the convention of dockerfile ending with a newline
aradwann 86bdda4
remove excessive build arg
aradwann 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 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 |
---|---|---|
|
@@ -76,7 +76,7 @@ jobs: | |
run: rustup target add aarch64-apple-darwin | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected].4 | ||
uses: mozilla-actions/[email protected].6 | ||
|
||
- name: Cache Rust | ||
uses: Swatinem/rust-cache@v2 | ||
|
@@ -194,7 +194,7 @@ jobs: | |
EOF | ||
|
||
- name: Build and push multiplatform image | ||
uses: docker/build-push-action@v5 | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
|
This file contains 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 |
---|---|---|
|
@@ -67,10 +67,22 @@ jobs: | |
# https://docs.warpbuild.com/cache/docker-layer-caching#step-1-set-up-docker-buildx-action | ||
driver-opts: | | ||
network=host | ||
|
||
- name: Cache sccache | ||
uses: actions/cache@v4 | ||
with: | ||
path: sccache-cache | ||
key: ${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Inject sccache-cache into Docker | ||
uses: reproducible-containers/buildkit-cache-dance@v3 | ||
with: | ||
cache-map: | | ||
{ | ||
"sccache-cache": "/var/cache/sccache" | ||
} | ||
skip-extraction: ${{ steps.cache.outputs.cache-hit }} | ||
|
||
- name: Log into GitHub container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
|
@@ -107,7 +119,7 @@ jobs: | |
|
||
- name: Build${{inputs.uploadImageAsTarball != true && ' and push ' || ' '}}Docker image | ||
id: build | ||
uses: docker/build-push-action@v5 | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: "docker/Dockerfile" | ||
|
@@ -119,13 +131,10 @@ jobs: | |
network: host | ||
build-args: | | ||
CARGO_PROFILE_RELEASE_DEBUG=${{ inputs.debug }} | ||
ACTIONS_CACHE_URL=http://127.0.0.1:49160/ | ||
ACTIONS_RUNTIME_TOKEN | ||
SCCACHE_GHA_ENABLED=true | ||
RESTATE_FEATURES=${{ inputs.features || '' }} | ||
cache-from: type=gha,scope=${{ github.workflow }},url=http://127.0.0.1:49160/ | ||
cache-to: type=gha,mode=max,scope=${{ github.workflow }},url=http://127.0.0.1:49160/ | ||
|
||
cache-from: type=gha,url=http://127.0.0.1:49160/ | ||
cache-to: type=gha,url=http://127.0.0.1:49160/,mode=max | ||
- name: Save docker image as tar | ||
if: ${{ inputs.uploadImageAsTarball }} | ||
run: | | ||
|
@@ -144,7 +153,7 @@ jobs: | |
# This won't actually build again, it'll just use cache | ||
- name: Push Docker image | ||
if: ${{ inputs.uploadImageAsTarball && github.ref == 'refs/heads/main' }} | ||
uses: docker/build-push-action@v5 | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: "docker/Dockerfile" | ||
|
@@ -157,9 +166,8 @@ jobs: | |
network: host | ||
build-args: | | ||
CARGO_PROFILE_RELEASE_DEBUG=${{ inputs.debug }} | ||
ACTIONS_CACHE_URL=http://127.0.0.1:49160/ | ||
ACTIONS_RUNTIME_TOKEN | ||
SCCACHE_GHA_ENABLED=true | ||
RESTATE_FEATURES=${{ inputs.features || '' }} | ||
cache-from: type=gha,scope=${{ github.workflow }},url=http://127.0.0.1:49160/ | ||
cache-to: type=gha,mode=max,scope=${{ github.workflow }},url=http://127.0.0.1:49160/ | ||
SCCACHE_DIR=/sccache-cache | ||
cache-from: type=gha,url=http://127.0.0.1:49160/ | ||
cache-to: type=gha,url=http://127.0.0.1:49160/,mode=max | ||
|
This file contains 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.
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.
nit: can the file continue to end in a newline?