-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (55 loc) · 1.52 KB
/
ci.yml
File metadata and controls
67 lines (55 loc) · 1.52 KB
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
name: CI
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: go build -v cmd/webhook/main.go
- name: Test
run: go test -v ./...
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . -t webhook:latest
e2e-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: modify host
run: cd test/e2e/pretest && sudo ./modify_host.sh
- name: run e2e test
run: cd test/e2e && ./test.sh
adaptor-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: download minikube
run: curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && sudo install minikube-linux-amd64 /usr/local/bin/minikube
- name: start minikube
run: minikube start
- name: setup k8s
run: kubectl create namespace kubesphere-authz-system && kubectl --namespace=kubesphere-authz-system apply -f test/adaptor/crd_example.yaml
- name: install crd
run: make install
- name: run test
run: cd test/adaptor && go run .