-
Notifications
You must be signed in to change notification settings - Fork 27
78 lines (76 loc) · 2.11 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build and Test Pull Request
# Trigger the workflow on push or pull request
on:
push:
pull_request:
env:
GO_VERSION: 1.22
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
cache: false # avoid issue like ttributes_test.go: Cannot open: File exists
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
args: --out-format=colored-line-number
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
- name: test
run: |
make test
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
- name: build
run: |
make build
build-docker-image-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
- name: image-amd64-build-only
run: |
make image-amd64-build-only
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-${{ github.job }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-go-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: add deps to path
run: |
./hack/actions/install-kubernetes-toolchain.sh $GITHUB_WORKSPACE/bin
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: e2e tests
run: |
make e2e