File tree 4 files changed +32
-12
lines changed
4 files changed +32
-12
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ name: Go
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [ main, dev/hackathon-dec-2023 ]
6
6
pull_request :
7
- branches : [ main ]
7
+ branches : [ main, dev/hackathon-dec-2023 ]
8
8
9
9
jobs :
10
10
11
- build :
11
+ test :
12
12
runs-on : ubuntu-latest
13
13
steps :
14
14
- uses : actions/checkout@v3
@@ -18,11 +18,21 @@ jobs:
18
18
with :
19
19
go-version : 1.21
20
20
21
- - name : Build
22
- run : go build -v ./...
23
-
24
21
- name : Test
25
- run : go test ./...
22
+ run : make test
26
23
27
24
- name : Benchmark
28
- run : go test -v -run=XXX -benchmem -bench=. ./...
25
+ run : make benchmark
26
+
27
+ checks :
28
+ runs-on : ubuntu-latest
29
+ steps :
30
+ - uses : actions/checkout@v3
31
+
32
+ - name : Set up Go
33
+ uses : actions/setup-go@v3
34
+ with :
35
+ go-version : 1.21
36
+
37
+ - name : Checks
38
+ run : make checks
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ BUILDFLAGS = -v
4
4
BENCH = .
5
5
BENCHFLAGS = -benchmem -bench=${BENCH}
6
6
7
+ IMAGE_PREFIX ?= us.gcr.io/kubernetes-dev
8
+ GIT_VERSION ?= $(shell git describe --tags --always --dirty)
9
+
7
10
build :
8
11
go build ${BUILDFLAGS} ${PKGS}
9
12
@@ -15,9 +18,16 @@ benchmark:
15
18
16
19
checks :
17
20
go vet ${PKGS}
18
- staticcheck ${PKGS}
21
+ go run honnef.co/go/tools/cmd/ staticcheck@latest ${PKGS}
19
22
make lint
20
23
21
24
lint :
22
- go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run -c .golangci.yml -v
25
+ go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run -c .golangci.yml
26
+
27
+ docker :
28
+ docker build --build-arg=GIT_VERSION=$(GIT_VERSION ) -t $(IMAGE_PREFIX ) /unused -f Dockerfile.exporter .
29
+ docker tag $(IMAGE_PREFIX ) /unused $(IMAGE_PREFIX ) /unused:$(GIT_VERSION )
23
30
31
+ push : docker
32
+ docker push $(IMAGE_PREFIX ) /unused:$(GIT_VERSION )
33
+ docker push $(IMAGE_PREFIX ) /unused:latest
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ func (p *Provider) Name() string { return "Azure" }
25
25
// Meta returns the provider metadata.
26
26
func (p * Provider ) Meta () unused.Meta { return p .meta }
27
27
28
- // Id returns the subscription for this provider.
28
+ // ID returns the subscription for this provider.
29
29
func (p * Provider ) ID () string { return p .client .SubscriptionID }
30
30
31
31
// NewProvider creates a new Azure [unused.Provider].
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ func (e *exporter) pollProvider(p unused.Provider) {
182
182
}
183
183
184
184
addMetric (e .info , 1 )
185
- addMetric (e .dur , int64 ( dur .Microseconds () ))
185
+ addMetric (e .dur , dur .Microseconds ())
186
186
addMetric (e .suc , success )
187
187
188
188
for ns , di := range diskInfoByNamespace {
You can’t perform that action at this time.
0 commit comments