Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 82f48f7

Browse files
authored
Merge pull request #4772 from nojnhuh/ci
Update Go CI config
2 parents 8fd236e + db71482 commit 82f48f7

File tree

8 files changed

+44
-154
lines changed

8 files changed

+44
-154
lines changed

.github/workflows/codeql-analysis.yml

-13
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,6 @@ jobs:
3636
steps:
3737
- name: Checkout repository
3838
uses: actions/checkout@v2
39-
- name: Restore Module Cache
40-
uses: actions/cache@v2
41-
with:
42-
path: ~/go/pkg/mod
43-
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
44-
restore-keys: |
45-
${{ runner.os }}-gomod2-
46-
- name: Restore Build Cache
47-
uses: actions/cache@v2
48-
with:
49-
path: ~/.cache/go-build
50-
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
51-
5239
# Initializes the CodeQL tools for scanning.
5340
- name: Initialize CodeQL
5441
uses: github/codeql-action/init@v1

.github/workflows/main.yml

+28-103
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ jobs:
4040
steps:
4141
- name: Checkout
4242
uses: actions/checkout@v2
43-
- name: Setup Go 1.17
44-
uses: actions/setup-go@v2
43+
- name: Setup Go
44+
uses: actions/setup-go@v3
4545
with:
46-
go-version: 1.17
46+
go-version-file: go.mod
47+
cache: true
4748
- name: go build deps
4849
run: make embed-files-test
4950
- name: golangci-lint
@@ -58,10 +59,11 @@ jobs:
5859
steps:
5960
- name: Checkout
6061
uses: actions/checkout@v2
61-
- name: Setup Go 1.17
62-
uses: actions/setup-go@v2
62+
- name: Setup Go
63+
uses: actions/setup-go@v3
6364
with:
64-
go-version: 1.17
65+
go-version-file: go.mod
66+
cache: true
6567
- name: go mod tidy
6668
run: make go-mod-tidy
6769
- name: Codegen checks
@@ -73,10 +75,11 @@ jobs:
7375
steps:
7476
- name: Checkout
7577
uses: actions/checkout@v2
76-
- name: Setup Go 1.17
77-
uses: actions/setup-go@v2
78+
- name: Setup Go
79+
uses: actions/setup-go@v3
7880
with:
79-
go-version: 1.17
81+
go-version-file: go.mod
82+
cache: true
8083
- name: go mod tidy
8184
run: make go-mod-tidy
8285
- name: gomock checks
@@ -97,22 +100,11 @@ jobs:
97100
steps:
98101
- name: Checkout
99102
uses: actions/checkout@v2
100-
- name: Restore Module Cache
101-
uses: actions/cache@v2
103+
- name: Setup Go
104+
uses: actions/setup-go@v3
102105
with:
103-
path: ~/go/pkg/mod
104-
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
105-
restore-keys: |
106-
${{ runner.os }}-gomod2-
107-
- name: Restore Build Cache
108-
uses: actions/cache@v2
109-
with:
110-
path: ~/.cache/go-build
111-
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
112-
- name: Setup Go 1.17
113-
uses: actions/setup-go@v2
114-
with:
115-
go-version: 1.17
106+
go-version-file: go.mod
107+
cache: true
116108
- name: Go Build
117109
run: make build-ci
118110

@@ -123,22 +115,11 @@ jobs:
123115
steps:
124116
- name: Checkout
125117
uses: actions/checkout@v2
126-
- name: Restore Module Cache
127-
uses: actions/cache@v2
128-
with:
129-
path: ~/go/pkg/mod
130-
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
131-
restore-keys: |
132-
${{ runner.os }}-gomod2-
133-
- name: Restore Build Cache
134-
uses: actions/cache@v2
135-
with:
136-
path: ~/.cache/go-build
137-
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
138-
- name: Setup Go 1.17
139-
uses: actions/setup-go@v2
118+
- name: Setup Go
119+
uses: actions/setup-go@v3
140120
with:
141-
go-version: 1.17
121+
go-version-file: go.mod
122+
cache: true
142123
- name: go mod tidy
143124
run: make go-mod-tidy
144125
- name: Test
@@ -149,35 +130,6 @@ jobs:
149130
with:
150131
flags: unittests
151132

152-
scenarios_tests:
153-
name: Test various Envoy + SMI configuration scenarios
154-
runs-on: ubuntu-latest
155-
needs: build
156-
steps:
157-
- name: Checkout
158-
uses: actions/checkout@v2
159-
- name: Restore Module Cache
160-
uses: actions/cache@v2
161-
with:
162-
path: ~/go/pkg/mod
163-
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
164-
restore-keys: |
165-
${{ runner.os }}-gomod2-
166-
- name: Restore Build Cache
167-
uses: actions/cache@v2
168-
with:
169-
path: ~/.cache/go-build
170-
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
171-
- name: Setup Go 1.17
172-
uses: actions/setup-go@v2
173-
with:
174-
go-version: 1.17
175-
- name: Test
176-
run: |
177-
touch .env
178-
make kind-up
179-
go test -v ./tests/scenarios/...
180-
181133
imagescan:
182134
name: Scan images for security vulnerabilities
183135
runs-on: ubuntu-latest
@@ -221,22 +173,11 @@ jobs:
221173
steps:
222174
- name: Checkout
223175
uses: actions/checkout@v2
224-
- name: Restore Module Cache
225-
uses: actions/cache@v2
226-
with:
227-
path: ~/go/pkg/mod
228-
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
229-
restore-keys: |
230-
${{ runner.os }}-gomod2-
231-
- name: Restore Build Cache
232-
uses: actions/cache@v2
233-
with:
234-
path: ~/.cache/go-build
235-
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
236-
- name: Setup Go 1.17
237-
uses: actions/setup-go@v2
176+
- name: Setup Go
177+
uses: actions/setup-go@v3
238178
with:
239-
go-version: 1.17
179+
go-version-file: go.mod
180+
cache: true
240181
- name: Build test dependencies
241182
env:
242183
DOCKER_BUILDX_OUTPUT: type=docker
@@ -275,27 +216,11 @@ jobs:
275216
steps:
276217
- name: Checkout
277218
uses: actions/checkout@v2
278-
279-
- name: Restore Module Cache
280-
uses: actions/cache@v2
281-
with:
282-
path: ~/go/pkg/mod
283-
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
284-
restore-keys: |
285-
${{ runner.os }}-gomod2-
286-
287-
- name: Restore Build Cache
288-
uses: actions/cache@v2
219+
- name: Setup Go
220+
uses: actions/setup-go@v3
289221
with:
290-
path: ~/.cache/go-build
291-
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
292-
293-
- name: Setup Go 1.17
294-
uses: actions/setup-go@v2
295-
with:
296-
go-version: 1.17
297-
id: go
298-
222+
go-version-file: go.mod
223+
cache: true
299224
- name: Run Simulation w/ Tresor, SMI policies, egress disabled and reconciler disabled
300225
env:
301226
CERT_MANAGER: "tresor"

.github/workflows/nightly-noinstall.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ jobs:
5050
run: |
5151
kubectl version
5252
kubectl get nodes
53-
- name: Setup Go 1.17
54-
uses: actions/setup-go@v2
53+
- name: Setup Go
54+
uses: actions/setup-go@v3
5555
with:
56-
go-version: 1.17
56+
go-version-file: go.mod
57+
cache: true
5758
- name: Install OSM via OSM CLI
5859
run: |
5960
make build-osm

.github/workflows/openshift-nightly.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ jobs:
2424
insecure_skip_tls_verify: true
2525
- name: Test oc
2626
run: oc version --client
27-
- name: Setup Go 1.17
28-
uses: actions/setup-go@v2
27+
- name: Setup Go
28+
uses: actions/setup-go@v3
2929
with:
30-
go-version: 1.17
30+
go-version-file: go.mod
31+
cache: true
3132
- name: Run e2es
3233
run: |
3334
make build-osm

.github/workflows/release.yml

+4-15
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,11 @@ jobs:
2727
uses: actions/checkout@v2
2828
with:
2929
fetch-depth: 0
30-
- name: Restore Module Cache
31-
uses: actions/cache@v2
30+
- name: Setup Go
31+
uses: actions/setup-go@v3
3232
with:
33-
path: ~/go/pkg/mod
34-
key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }}
35-
restore-keys: |
36-
${{ runner.os }}-gomod2-
37-
- name: Restore Build Cache
38-
uses: actions/cache@v2
39-
with:
40-
path: ~/.cache/go-build
41-
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
42-
- name: Setup Go 1.17
43-
uses: actions/setup-go@v2
44-
with:
45-
go-version: 1.17
33+
go-version-file: go.mod
34+
cache: true
4635
- name: Build Binaries
4736
run: |
4837
make release-artifacts

.github/workflows/windows-nightly.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ jobs:
2222
method: kubeconfig
2323
kubeconfig: ${{ secrets.CI_WINDOWS_KUBECONFIG }}
2424
id: setcontext
25-
- name: Setup Go 1.17
26-
uses: actions/setup-go@v2
25+
- name: Setup Go
26+
uses: actions/setup-go@v3
2727
with:
28-
go-version: 1.17
28+
go-version-file: go.mod
29+
cache: true
2930
- name: Run e2es
3031
run: |
3132
make build-osm

scripts/test-w-coverage.sh

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ set -aueo pipefail
55
modules=$(go list ./... | \
66
grep -v tests/framework | \
77
grep -v tests/e2e | \
8-
grep -v tests/scenarios | \
98
grep -v tests/scale | \
109
grep -v ci/ | \
1110
grep -v demo/ | \

tests/scenarios/suite_test.go

-13
This file was deleted.

0 commit comments

Comments
 (0)