Skip to content

Commit ec25e00

Browse files
[8.17] (backport #16788) ci: use manual caching with actions/cache (#16789)
* ci: use manual caching with actions/cache (#16788) * ci: use manual caching with actions/cache use os agnostic cache key only cache pkg mod cache * ci: enable enableCrossOsArchive by default cache won't be shared across os enable it so we can reuse the go module cache (cherry picked from commit bac9fec) # Conflicts: # .github/workflows/ci.yml * Update ci.yml * Update ci.yml * feat: bump elastic-agent-client lib to fix race condition --------- Co-authored-by: kruskall <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 2c3fe51 commit ec25e00

File tree

4 files changed

+33
-26
lines changed

4 files changed

+33
-26
lines changed

.github/workflows/ci.yml

+28-21
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ jobs:
3131
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
3232
with:
3333
go-version-file: go.mod
34-
cache: true
35-
cache-dependency-path: |
36-
go.sum
37-
tools/go.sum
34+
cache: false
35+
- uses: actions/[email protected]
36+
with:
37+
path: |
38+
~/go/pkg/mod/cache
39+
key: go-${{ hashFiles('go.mod') }}
40+
restore-keys: |
41+
go-
3842
- run: make check-full
3943
- name: Ensure .go-version is up to date
4044
run: make update-go-version
@@ -50,10 +54,16 @@ jobs:
5054
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
5155
with:
5256
go-version-file: go.mod
53-
cache: true
54-
- env:
55-
CGO_ENABLED: "0"
56-
run: go test -v ./...
57+
cache: false
58+
- uses: actions/[email protected]
59+
with:
60+
enableCrossOsArchive: true
61+
path: |
62+
~/go/pkg/mod/cache
63+
key: go-${{ hashFiles('go.mod') }}
64+
restore-keys: |
65+
go-
66+
- run: go test -v -race ./...
5767

5868
system-test:
5969
runs-on: ubuntu-latest
@@ -62,22 +72,19 @@ jobs:
6272
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
6373
with:
6474
go-version-file: systemtest/go.mod
65-
cache: true
75+
cache: false
6676
- run: docker compose up -d
77+
- uses: actions/[email protected]
78+
with:
79+
path: |
80+
~/go/pkg/mod/cache
81+
key: systemtest-go-${{ hashFiles('systemtest/go.mod', 'go.mod') }}
82+
restore-keys: |
83+
systemtest-go-
6784
- env:
68-
GOTESTFLAGS: "-v -json"
69-
OUTPUT_JSON_FILE: "build/TEST-go-system_tests.out.json"
70-
OUTPUT_JUNIT_FILE: "build/TEST-go-system_tests.xml"
85+
GOTESTFLAGS: "-v"
7186
GH_TOKEN: ${{ github.token }}
72-
run: |
73-
go run -modfile=tools/go.mod gotest.tools/gotestsum \
74-
--no-color -f standard-quiet --jsonfile "$OUTPUT_JSON_FILE" --junitfile "$OUTPUT_JUNIT_FILE" \
75-
--raw-command -- make system-test
76-
- uses: actions/upload-artifact@v4 # upload test results
77-
if: ${{ always() }} # run this step even if previous step failed
78-
with:
79-
name: test-results
80-
path: 'build/*.xml'
87+
run: make system-test
8188

8289
test-package:
8390
runs-on: ubuntu-latest

NOTICE.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -596,11 +596,11 @@ License Version 2.0.
596596

597597
--------------------------------------------------------------------------------
598598
Dependency : github.com/elastic/elastic-agent-client/v7
599-
Version: v7.16.0
599+
Version: v7.17.2
600600
Licence type (autodetected): Elastic
601601
--------------------------------------------------------------------------------
602602

603-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-client/v7@v7.16.0/LICENSE.txt:
603+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-client/v7@v7.17.2/LICENSE.txt:
604604

605605
ELASTIC LICENSE AGREEMENT
606606

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/elastic/apm-aggregation v1.1.0
1010
github.com/elastic/apm-data v1.14.1
1111
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250502181748-53ce29a905b4
12-
github.com/elastic/elastic-agent-client/v7 v7.16.0
12+
github.com/elastic/elastic-agent-client/v7 v7.17.2
1313
github.com/elastic/elastic-agent-libs v0.18.9
1414
github.com/elastic/elastic-agent-system-metrics v0.11.11
1515
github.com/elastic/gmux v0.3.2

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250502181748-53ce29a905b4 h1:lVX0Q
136136
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250502181748-53ce29a905b4/go.mod h1:xEACB/kX8UTJ18Gdtdzs069UmGQ+Qeg8zxAG8swT7+Y=
137137
github.com/elastic/elastic-agent-autodiscover v0.9.0 h1:+iWIKh0u3e8I+CJa3FfWe9h0JojNasPgYIA47gpuuns=
138138
github.com/elastic/elastic-agent-autodiscover v0.9.0/go.mod h1:5iUxLHhVdaGSWYTveSwfJEY4RqPXTG13LPiFoxcpFd4=
139-
github.com/elastic/elastic-agent-client/v7 v7.16.0 h1:yKGq2+CxAuW8Kh0EoNl202tqAyQKfBcPRawVKs2Jve0=
140-
github.com/elastic/elastic-agent-client/v7 v7.16.0/go.mod h1:6h+f9QdIr3GO2ODC0Y8+aEXRwzbA5W4eV4dd/67z7nI=
139+
github.com/elastic/elastic-agent-client/v7 v7.17.2 h1:Cl2TeABqWZgW40t5fchGWT/sRk4MDDLWA0d8iHHOxLA=
140+
github.com/elastic/elastic-agent-client/v7 v7.17.2/go.mod h1:5irRFqp6HLqtu1S+OeY0jg8x7K6PLL+DW+PwVk1vJnk=
141141
github.com/elastic/elastic-agent-libs v0.18.9 h1:NQbBK6uMd/t4S0Fe7iOpT5mE7RXMWVaOLBSEXHRBzWI=
142142
github.com/elastic/elastic-agent-libs v0.18.9/go.mod h1:Repx7BMzE1v/gTipPogNIQeEnSGwOWGBC63h7h9c5aM=
143143
github.com/elastic/elastic-agent-system-metrics v0.11.11 h1:Qjh3Zef23PfGlG91AF+9ciNLNQf/8cDJ4CalnLZtV3g=

0 commit comments

Comments
 (0)