generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 22
92 lines (90 loc) · 2.4 KB
/
ci.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
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI Workflow
on:
# Run this workflow every time a new commit pushed to upstream/fork repository.
# Run workflow on fork repository will help contributors find and resolve issues before sending a PR.
push:
pull_request:
defaults:
run:
working-directory: go/src/sigs.k8s.io/work-api
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22.6
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# the version of golangci-lint.
version: v1.58.0
# show only new issues if it's a pull request.
only-new-issues: false
args: --timeout 3m0s
verify:
name: verify
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/sigs.k8s.io/work-api
- name: install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.6
- name: verify
run: hack/verify-all.sh -v
env:
GOPATH: '/home/runner/work/work-api/work-api/go'
test:
name: unit test
needs: verify
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/sigs.k8s.io/work-api
- name: install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.6
- name: make test
run: make test
env:
GOPATH: '/home/runner/work/work-api/work-api/go'
e2e:
name: e2e
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/sigs.k8s.io/work-api
- name: install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.6
- name: images
run: make docker-build
env:
GOPATH: '/home/runner/work/work-api/work-api/go'
- name: setup kind
uses: engineerd/[email protected]
with:
version: v0.11.1
- name: Load image on the nodes of the cluster
run: |
kind load docker-image --name=kind work-api-controller:latest
- name: Run e2e test
run: |
make test-e2e
env:
KUBECONFIG: /home/runner/.kube/config