diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1dc70b4ba1..addf67f9bd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -35,10 +35,18 @@ jobs: persist-credentials: false - name: Set up Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 # zizmor: ignore[cache-poisoning] go.sum verifies module integrity with: go-version-file: "go.mod" - cache: "false" + cache: true + + - name: Go build cache + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 # zizmor: ignore[cache-poisoning] go build cache is content-addressable and self-verifying + with: + path: ~/.cache/go-build + key: go-build-pr-race-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.go', 'go.sum') }} + restore-keys: | + go-build-pr-race-${{ runner.os }}-${{ runner.arch }}- - name: Run verification and unit tests run: make docker-generate verify cov-exclude-generated check-go-mod notices-update check-ebpf-ver-synced check-config-schema check-clean-work-tree diff --git a/.github/workflows/pull_request_integration_tests_arm.yml b/.github/workflows/pull_request_integration_tests_arm.yml index 0d3a82b9da..803c7ac026 100644 --- a/.github/workflows/pull_request_integration_tests_arm.yml +++ b/.github/workflows/pull_request_integration_tests_arm.yml @@ -120,10 +120,18 @@ jobs: persist-credentials: false - name: Set up Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 # zizmor: ignore[cache-poisoning] go.sum verifies module integrity with: go-version-file: "go.mod" - cache: false + cache: true + + - name: Go build cache + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 # zizmor: ignore[cache-poisoning] go build cache is content-addressable and self-verifying + with: + path: ~/.cache/go-build + key: go-build-integration-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.go', 'go.sum') }} + restore-keys: | + go-build-integration-${{ runner.os }}-${{ runner.arch }}- - name: Generate files run: make prereqs docker-generate diff --git a/.github/workflows/pull_request_k8s_integration_tests.yml b/.github/workflows/pull_request_k8s_integration_tests.yml index 0be0a99ffe..5130d00f9c 100644 --- a/.github/workflows/pull_request_k8s_integration_tests.yml +++ b/.github/workflows/pull_request_k8s_integration_tests.yml @@ -112,10 +112,18 @@ jobs: persist-credentials: false - name: Set up Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 # zizmor: ignore[cache-poisoning] go.sum verifies module integrity with: go-version-file: "go.mod" - cache: false + cache: true + + - name: Go build cache + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 # zizmor: ignore[cache-poisoning] go build cache is content-addressable and self-verifying + with: + path: ~/.cache/go-build + key: go-build-k8s-integration-race-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.go', 'go.sum') }} + restore-keys: | + go-build-k8s-integration-race-${{ runner.os }}-${{ runner.arch }}- - name: Generate files run: make prereqs docker-generate diff --git a/.github/workflows/pull_request_oats_test.yml b/.github/workflows/pull_request_oats_test.yml index 26fac056ea..18430babe8 100644 --- a/.github/workflows/pull_request_oats_test.yml +++ b/.github/workflows/pull_request_oats_test.yml @@ -112,10 +112,18 @@ jobs: persist-credentials: false - name: Set up Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 # zizmor: ignore[cache-poisoning] go.sum verifies module integrity with: go-version-file: "go.mod" - cache: false + cache: true + + - name: Go build cache + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 # zizmor: ignore[cache-poisoning] go build cache is content-addressable and self-verifying + with: + path: ~/.cache/go-build + key: go-build-oats-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.go', 'go.sum') }} + restore-keys: | + go-build-oats-${{ runner.os }}-${{ runner.arch }}- - name: Run oats tests env: diff --git a/.github/workflows/workflow_integration_tests_vm.yml b/.github/workflows/workflow_integration_tests_vm.yml index 4db29163fd..3e3c674fe5 100644 --- a/.github/workflows/workflow_integration_tests_vm.yml +++ b/.github/workflows/workflow_integration_tests_vm.yml @@ -122,10 +122,18 @@ jobs: persist-credentials: false - name: Set up Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 # zizmor: ignore[cache-poisoning] go.sum verifies module integrity with: go-version-file: "go.mod" - cache: false + cache: true + + - name: Go build cache + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 # zizmor: ignore[cache-poisoning] go build cache is content-addressable and self-verifying + with: + path: ~/.cache/go-build + key: go-build-vm-integration-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.go', 'go.sum') }} + restore-keys: | + go-build-vm-integration-${{ runner.os }}-${{ runner.arch }}- - name: Generate files run: make prereqs docker-generate