Skip to content

ci: use manual caching with actions/cache #16788

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

Merged
merged 2 commits into from
May 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 49 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ jobs:
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
with:
go-version-file: go.mod
cache: true
cache-dependency-path: |
go.sum
cache: false
- uses: actions/[email protected]
with:
path: |
~/go/pkg/mod/cache
key: go-${{ hashFiles('go.mod') }}
restore-keys: |
go-
- run: make check-full

test:
Expand All @@ -44,16 +49,18 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: antontroshin/setup-go@bda02de8887c9946189f81e7e59512914aeb9ea4 # bda02de8887c9946189f81e7e59512914aeb9ea4
if: runner.os == 'Windows'
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
if: runner.os != 'Windows'
with:
go-version-file: go.mod
cache: true
cache: false
- uses: actions/[email protected]
with:
enableCrossOsArchive: true
path: |
~/go/pkg/mod/cache
key: go-${{ hashFiles('go.mod') }}
restore-keys: |
go-
- run: go test -v -race ./...

functional-test:
Expand All @@ -63,7 +70,14 @@ jobs:
- uses: actions/[email protected]
with:
go-version-file: functionaltests/go.mod
cache: true
cache: false
- uses: actions/[email protected]
with:
path: |
~/go/pkg/mod/cache
key: functionaltests-go-${{ hashFiles('functionaltests/go.mod') }}
restore-keys: |
functionaltests-go-
- env:
KIBANA_URL: "https://kibana.test"
KIBANA_USERNAME: "dummy"
Expand All @@ -82,7 +96,14 @@ jobs:
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
with:
go-version-file: go.mod
cache: true
cache: false
- uses: actions/[email protected]
with:
path: |
~/go/pkg/mod/cache
key: go-${{ hashFiles('go.mod') }}
restore-keys: |
go-
- env:
GOFIPS140: "latest"
GODEBUG: "fips140=only"
Expand All @@ -95,11 +116,15 @@ jobs:
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
with:
go-version-file: systemtest/go.mod
cache: true
cache-dependency-path: |
go.sum
systemtest/go.sum
cache: false
- run: docker compose up -d
- uses: actions/[email protected]
with:
path: |
~/go/pkg/mod/cache
key: systemtest-go-${{ hashFiles('systemtest/go.mod', 'go.mod') }}
restore-keys: |
systemtest-go-
- env:
GOTESTFLAGS: "-v"
GH_TOKEN: ${{ github.token }}
Expand All @@ -112,11 +137,15 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: systemtest/go.mod
cache: true
cache-dependency-path: |
go.sum
systemtest/go.sum
cache: false
- run: docker compose up -d
- uses: actions/[email protected]
with:
path: |
~/go/pkg/mod/cache
key: systemtest-go-${{ hashFiles('systemtest/go.mod', 'go.mod') }}
restore-keys: |
systemtest-go-
- env:
GOTESTFLAGS: "-v -tags=requirefips"
GOFIPS140: "latest"
Expand All @@ -132,8 +161,6 @@ jobs:
with:
go-version-file: go.mod
cache: false
cache-dependency-path: |
go.sum
- run: make package-snapshot
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -150,8 +177,6 @@ jobs:
with:
go-version-file: go.mod
cache: false
cache-dependency-path: |
go.sum
- name: Log in to the Elastic Container registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
Expand Down