Skip to content

Conversation

ncsokas
Copy link

@ncsokas ncsokas commented Jul 9, 2025

This pull request updates the labs/build-cache.md file to improve clarity, correct terminology, and enhance the guidance on caching and artifact usage in GitHub Actions workflows. The most important changes include fixing typos, adding a comparison of caching vs. artifacts, and providing a detailed example workflow for caching and artifact management.

  • Provided a detailed example of a GitHub Actions workflow for caching Gradle dependencies, managing Docker layer caching, and using artifacts for cross-job communication. This includes a fully fleshed-out YAML example with caching and artifact upload/download steps.
  • Recommended using docker/build-push-action for efficient Docker layer caching and suggested changing workflow triggers to workflow_dispatch to avoid unnecessary runs.

@ncsokas ncsokas requested review from moller2866 and amrutashety July 9, 2025 08:34
Copy link

@amrutashety amrutashety left a comment

Choose a reason for hiding this comment

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

LGTM

@ncsokas ncsokas marked this pull request as draft August 19, 2025 13:04
Copy link
Contributor

@michaelin michaelin left a comment

Choose a reason for hiding this comment

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

Added initial findings. More may come when I've run the exercise myself.

@@ -27,20 +27,188 @@ The example for gradle can be seen below.
${{ runner.os }}-gradle-
```

To use cache at the consequtive jobs, the same code (from above example) has to be added as a step.
To use cache at the consecutive jobs, the same code (from above example) has to be added as a step to each job.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To use cache at the consecutive jobs, the same code (from above example) has to be added as a step to each job.
To use the cache in subsequent jobs, a step with the same cache configuration has to be added to each job.

The change from "consecutive" to "subsequent" is most important. The rest of the suggestion just my preference.

Comment on lines +36 to +37
## Recap: Caching vs. Artifacts
`actions/cache`: Its purpose is to speed up future workflow runs by saving and reusing files that don't change often, like third-party dependencies (~/.gradle/caches). It is not designed to pass files between jobs in the same run.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Recap: Caching vs. Artifacts
`actions/cache`: Its purpose is to speed up future workflow runs by saving and reusing files that don't change often, like third-party dependencies (~/.gradle/caches). It is not designed to pass files between jobs in the same run.
## Recap: Caching vs. Artifacts
`actions/cache`: Its purpose is to speed up future workflow runs by saving and reusing files that don't change often, like third-party dependencies (~/.gradle/caches). It is not designed to pass files between jobs in the same run.

Nitpick: There should be a newline after headings

In this exercise the artifacts management in the existing pipeline will be changed to use caching instead as follow:
In this exercise we will implement caching as follows:

1. Create a new GitHub Actions file under `./github/workflows/caching.yaml` with exact copy of the pipeline from [exercise 7](../trainer/.github/workflows/caching.yaml) .
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit iffy on terminology here. I would expect it to be called a "GitHub Actions workflow file"? Or here, maybe just a "workflow file", since we're already in context of GitHub Actions. The more we sprinkle GitHub Actions around, the more it sounds like marketing material for GitHub.

Suggested change
1. Create a new GitHub Actions file under `./github/workflows/caching.yaml` with exact copy of the pipeline from [exercise 7](../trainer/.github/workflows/caching.yaml) .
1. Create a new workflow file under `./github/workflows/caching.yaml` with an exact copy of the pipeline from [exercise 7](../trainer/.github/workflows/caching.yaml) .

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.

3 participants