-
Notifications
You must be signed in to change notification settings - Fork 85
79 lines (67 loc) · 1.94 KB
/
main.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
79
name: CI
'on':
- push
- pull_request
env:
GOPROXY: https://proxy.golang.org
GOPATH: ${{ github.workspace }}/go
jobs:
verify-goimports:
runs-on: ubuntu-latest
steps:
- name: Set up go
uses: actions/setup-go@v2
with:
go-version: '1.22'
stable: true
- run: |
echo "GOPATH=${HOME}/go" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: verify goimports
run: |
files=$(go run golang.org/x/tools/cmd/goimports -format-only -l .)
# Sadly goimports doesn't use exit codes
if [[ -n "${files}" ]]; then
echo "::error ::goimports should be run on these files:"
echo "${files}"
exit 1
fi
verify-gomod:
runs-on: ubuntu-latest
steps:
- name: Set up go
uses: actions/setup-go@v2
with:
go-version: '1.22'
stable: true
- run: |
echo "GOPATH=${HOME}/go" >> $GITHUB_ENV
- uses: actions/checkout@v2
- run: dev/format-gomod
- run: |
changes=$(git status --porcelain)
if [[ -n "${changes}" ]]; then
echo "::error Changes detected from go mod tidy:"
echo "${changes}"
exit 1
fi
kind-e2e:
name: Test with a Kind cluster
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-go@v1
with:
go-version: '1.22'
- name: Install latest version of Kind
run: |
GO111MODULE=on go get sigs.k8s.io/kind
- name: Create Kind cluster
run: |
PATH=$(go env GOPATH)/bin:$PATH kind create cluster --config .github/workflows/kind-config.yaml
- name: Run some sanity checks
# kubectl is already installed on the Github Ubuntu worker
run: |
kubectl get nodes -o wide
kubectl get pods --all-namespaces -o wide
kubectl get services --all-namespaces -o wide