-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.19 KB
/
Copy pathgo.yml
File metadata and controls
39 lines (36 loc) · 1.19 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
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
go:
name: nnctl
runs-on: avrea-ubuntu-latest-2-vcpu
defaults:
run:
working-directory: nnctl
env:
GOLANGCI_LINT_VERSION: v2.12.2
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: nnctl/go.mod
cache: true
cache-dependency-path: nnctl/go.mod
- run: go test -race ./...
- name: Measure coverage
run: |
go test -covermode=atomic -coverprofile=coverage.out ./...
go tool cover -func=coverage.out | tee coverage.txt
awk '$1 == "total:" { value = $3; sub(/%$/, "", value); found = 1; if (value + 0 < 59.0) exit 1 } END { if (!found) exit 2 }' coverage.txt
- run: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} run --config ../.golangci.yml ./...
- run: |
mkdir -p ../bin
go build -o ../bin/nnctl ./cmd/nnctl