-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconfig.yml
55 lines (55 loc) · 1.87 KB
/
config.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
version: 2.1
jobs:
build:
working_directory: ~/repo
docker:
- image: cimg/go:1.22
steps:
- checkout
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Install Dependencies
command: |
go get -v -t -d ./...
- save_cache:
key: go-mod-v1-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
- run:
name: Create a temp directory for artifacts
command: |
mkdir -p /tmp/artifacts
- run:
name: Lint go code
command: |
go vet ./...
go install golang.org/x/lint/golint@latest && golint ./...
- run:
name: Run tests
command: |
if [ "${CIRCLE_BRANCH}" == pull/* ];
GOEXPERIMENT=nocoverageredesign go test -v -cover -coverprofile=coverage.out ./...
else
GOEXPERIMENT=nocoverageredesign go test -v -cover -coverprofile=coverage.out --tags e2e ./...
fi
- run:
name: Coverage Report
command: |
go tool cover -html=coverage.out -o coverage.html
mv coverage.html /tmp/artifacts
when: always
- run:
name: Report test results to codecov
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x ./codecov
./codecov
- store_artifacts:
path: /tmp/artifacts