File tree 5 files changed +113
-20
lines changed
5 files changed +113
-20
lines changed Original file line number Diff line number Diff line change 6
6
paths :
7
7
- cmd/manager/*
8
8
- api/*
9
- - mysqlcluster/*
10
- - mysqlcluster/container/*
11
- - mysqlcluster/syncer/*
9
+ - mysqlcluster/**
12
10
- controllers/*
13
11
- internal/*
14
12
- utils/*
@@ -20,20 +18,19 @@ jobs:
20
18
build :
21
19
runs-on : ubuntu-latest
22
20
steps :
23
- -
24
- name : Set up QEMU
21
+ - name : Set up QEMU
25
22
uses : docker/setup-qemu-action@v1
26
- -
27
- name : Set up Docker Buildx
23
+
24
+ - name : Set up Docker Buildx
28
25
uses : docker/setup-buildx-action@v1
29
- -
30
- name : Login to DockerHub
26
+
27
+ - name : Login to DockerHub
31
28
uses : docker/login-action@v1
32
29
with :
33
30
username : ${{ secrets.DOCKERHUB_USERNAME }}
34
31
password : ${{ secrets.DOCKERHUB_TOKEN }}
35
- -
36
- name : Build and push
32
+
33
+ - name : Build and push
37
34
id : docker_build
38
35
uses : docker/build-push-action@v2
39
36
with :
Original file line number Diff line number Diff line change @@ -13,20 +13,19 @@ jobs:
13
13
build :
14
14
runs-on : ubuntu-latest
15
15
steps :
16
- -
17
- name : Set up QEMU
16
+ - name : Set up QEMU
18
17
uses : docker/setup-qemu-action@v1
19
- -
20
- name : Set up Docker Buildx
18
+
19
+ - name : Set up Docker Buildx
21
20
uses : docker/setup-buildx-action@v1
22
- -
23
- name : Login to DockerHub
21
+
22
+ - name : Login to DockerHub
24
23
uses : docker/login-action@v1
25
24
with :
26
25
username : ${{ secrets.DOCKERHUB_USERNAME }}
27
26
password : ${{ secrets.DOCKERHUB_TOKEN }}
28
- -
29
- name : Build and push
27
+
28
+ - name : Build and push
30
29
id : docker_build
31
30
uses : docker/build-push-action@v2
32
31
with :
Original file line number Diff line number Diff line change
1
+ name : code check
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+
7
+ gofmt :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - name : Set up Go
11
+ uses : actions/setup-go@v2
12
+ with :
13
+ go-version : 1.16
14
+
15
+ - name : Check out source code
16
+ uses : actions/checkout@v1
17
+
18
+ - name : run go fmt
19
+ run : d="$(gofmt -d ../../)" && if [ -n "$d" ]; then echo "Format error:" ; echo "$d"; exit 1; fi
20
+
21
+
22
+ check-crd :
23
+ runs-on : ubuntu-latest
24
+ steps :
25
+ - name : Set up Go
26
+ uses : actions/setup-go@v2
27
+ with :
28
+ go-version : 1.16
29
+
30
+ - name : Check out source code
31
+ uses : actions/checkout@v1
32
+
33
+ - name : recreate crd
34
+ run : make manifests
35
+
36
+ - name : check crd
37
+ run : diff charts/mysql-operator/crds config/crd/bases
38
+
39
+ staticcheck :
40
+ runs-on : ubuntu-latest
41
+ steps :
42
+ - name : Set up Go
43
+ uses : actions/setup-go@v2
44
+ with :
45
+ go-version : 1.16
46
+
47
+ - name : Check out source code
48
+ uses : actions/checkout@v1
49
+
50
+ - name : install staticcheck
51
+ run : go install honnef.co/go/tools/cmd/staticcheck@latest
52
+
53
+ - name : run staticcheck
54
+ run : staticcheck -f stylish ./...
Original file line number Diff line number Diff line change 1
- name : Greetings
1
+ name : greetings
2
2
3
3
on : issues
4
4
Original file line number Diff line number Diff line change
1
+ name : unit tests
2
+
3
+ on :
4
+ push :
5
+ branches : [ main, fmt_ci]
6
+ paths :
7
+ - mysqlcluster/**
8
+ - utils/*
9
+ pull_request :
10
+ branches : [ main, fmt_ci ]
11
+ paths :
12
+ - mysqlcluster/**
13
+ - utils/*
14
+
15
+ jobs :
16
+
17
+ test-cluster :
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - name : Set up Go
21
+ uses : actions/setup-go@v2
22
+ with :
23
+ go-version : 1.16
24
+
25
+ - name : Check out source code
26
+ uses : actions/checkout@v1
27
+
28
+ - name : run test
29
+ run : go test ./mysqlcluster/container/ ./mysqlcluster/ -v -cover
30
+
31
+ test-utils :
32
+ runs-on : ubuntu-latest
33
+ steps :
34
+ - name : Set up Go
35
+ uses : actions/setup-go@v2
36
+ with :
37
+ go-version : 1.16
38
+
39
+ - name : Check out source code
40
+ uses : actions/checkout@v1
41
+
42
+ - name : run test
43
+ run : go test ./utils/ -v -cover
You can’t perform that action at this time.
0 commit comments