Skip to content

chore(ci): cache Go modules and build artifacts in CI workflows#5262

Open
geyslan wants to merge 1 commit intoaquasecurity:mainfrom
geyslan:use-cache-for-go
Open

chore(ci): cache Go modules and build artifacts in CI workflows#5262
geyslan wants to merge 1 commit intoaquasecurity:mainfrom
geyslan:use-cache-for-go

Conversation

@geyslan
Copy link
Copy Markdown
Member

@geyslan geyslan commented Mar 19, 2026

1. Explain what the PR does

f537cbc chore(ci): add Go module and build caching to CI workflows

Cache ~/go/pkg/mod and the Go build cache across PR and daily test
workflows using actions/cache@v5.0.3.

Keys include go.mod hash so caches are busted on Go toolchain upgrades,
and an environment discriminator (alpine vs graas) to prevent Alpine
container jobs and GRAAS AMI jobs from overwriting each other's entries.

Also install the zstd package in Alpine deps, which actions/cache relies
on for archive compression on Linux.

--

2. Explain how to test it

3. Other comments

~28min https://github.com/aquasecurity/tracee/actions/runs/23299826132/attempts/1?pr=5262

~21min https://github.com/aquasecurity/tracee/actions/runs/23299826132/attempts/2?pr=5262

@geyslan geyslan requested a review from rscampos March 19, 2026 14:04
@geyslan geyslan self-assigned this Mar 19, 2026
Copilot AI review requested due to automatic review settings March 19, 2026 14:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to speed up Tracee’s Go-heavy CI workloads by introducing GitHub Actions caching for the Go module download cache and Go build cache across PR and daily workflows.

Changes:

  • Add actions/cache@v5.0.3 steps to cache Go module and build caches in Alpine-container CI jobs.
  • Add caching for GOPATH/GOCACHE locations in GRAAS AMI-based integration/E2E jobs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/test-daily.yaml Adds caching of ~/go/pkg/mod and ~/.cache/go-build for the scheduled libbpfgo daily compile job.
.github/workflows/pr.yaml Adds caching across multiple PR workflow jobs (lint/build/unit/integration/perf/e2e) for Go modules and build artifacts.

@geyslan geyslan force-pushed the use-cache-for-go branch 2 times, most recently from 96def08 to 7627c8f Compare March 19, 2026 14:27
@geyslan
Copy link
Copy Markdown
Member Author

geyslan commented Mar 24, 2026

Pinging for reviewing. 😬

@geyslan
Copy link
Copy Markdown
Member Author

geyslan commented Apr 1, 2026

/fast-forward

Copilot AI review requested due to automatic review settings April 1, 2026 23:22
@geyslan geyslan force-pushed the use-cache-for-go branch from 7627c8f to 96840eb Compare April 1, 2026 23:22
@geyslan geyslan requested a review from a team April 1, 2026 23:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR speeds up Tracee’s Go-heavy GitHub Actions workloads by introducing caching for the Go module download cache and Go build cache across CI workflows.

Changes:

  • Add actions/cache@v5.0.3 steps to cache Go module and build artifacts.
  • Apply caching to both Alpine container-based jobs and GRAAS AMI-based jobs, using OS/arch + go.sum hash keys.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/test-daily.yaml Adds caching for Go module/build caches in the daily libbpfgo compilation job.
.github/workflows/pr.yaml Adds caching for Go module/build caches across multiple PR CI jobs (Alpine containers + GRAAS AMIs).

@geyslan geyslan force-pushed the use-cache-for-go branch from 96840eb to 2a92461 Compare April 7, 2026 12:12
@geyslan geyslan requested a review from a team as a code owner April 7, 2026 12:12
trvll
trvll previously approved these changes Apr 7, 2026
Copy link
Copy Markdown
Contributor

@trvll trvll left a comment

Choose a reason for hiding this comment

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

+1

Cache ~/go/pkg/mod and the Go build cache across PR and daily test
workflows using actions/cache@v5.0.3.

Keys include go.mod hash so caches are busted on Go toolchain upgrades,
and an environment discriminator (alpine vs graas) to prevent Alpine
container jobs and GRAAS AMI jobs from overwriting each other's entries.

Also install the zstd package in Alpine deps, which actions/cache relies
on for archive compression on Linux.
Copilot AI review requested due to automatic review settings April 7, 2026 19:23
@geyslan geyslan force-pushed the use-cache-for-go branch from 2a92461 to f537cbc Compare April 7, 2026 19:23
@geyslan geyslan requested a review from trvll April 7, 2026 19:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants