File tree Expand file tree Collapse file tree 1 file changed +26
-71
lines changed
Expand file tree Collapse file tree 1 file changed +26
-71
lines changed Original file line number Diff line number Diff line change 11version : 2.1
2-
3- # Define resource classes
4- resource_class :
5- small : &small
6- cpu : 2
7- memory : 4GB
8- medium : &medium
9- cpu : 4
10- memory : 8GB
11- large : &large
12- cpu : 8
13- memory : 16GB
14-
152jobs :
16- # Define job templates
17- lint :
18- docker :
19- - image : circleci/golang:1.17
20- steps :
21- - checkout
22- - run : go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.1
23- - run : golangci-lint run ./...
24- test :
25- parallelism : 2
26- docker :
27- - image : circleci/golang:1.17
28- << : *medium
29- steps :
30- - checkout
31- - run : go mod download
32- - run : go test -race -coverprofile=coverage.txt -covermode=atomic ./...
33- # Cache dependencies between runs
34- key : go-modules-{{ .Branch }}-{{ checksum "go.mod" }}
35- caches :
36- - path : ~/go/pkg/mod
37-
383 build :
4+ resource_class : medium
395 docker :
40- - image : circleci/golang:1.17
41- << : *large
42- steps :
43- - checkout
44- - run : go mod download
45- - run : go build -o pulse-server .
46- # Cache dependencies between runs
47- key : go-modules-{{ .Branch }}-{{ checksum "go.mod" }}
48- caches :
49- - path : ~/go/pkg/mod
6+ - image : circleci/golang:latest
7+
8+ working_directory : /go/src/github.com/gopulse/pulse
509
51- deploy :
52- docker :
53- - image : alpine
54- << : *small
5510 steps :
5611 - checkout
57- - run : echo "Deploying..."
12+
13+ # Install dependencies
14+ - run :
15+ name : Install Dependencies
16+ command : |
17+ go mod download
18+
19+ # Build and test
20+ - run :
21+ name : Build and Test
22+ command : |
23+ go build -v ./...
24+ go test -timeout=5m -v ./...
25+
26+ # Upload coverage report
27+ - run :
28+ name : Upload Coverage Report
29+ command : |
30+ bash <(curl -s https://codecov.io/bash) -f coverage.out -t $CODECOV_TOKEN
5831
5932workflows :
60- version : 2.1
61- build-and-test :
33+ version : 2
34+ build :
6235 jobs :
63- - lint
64- - test :
65- requires :
66- - lint
67- filters :
68- branches :
69- only : master
70- - build :
71- requires :
72- - test
73- filters :
74- branches :
75- only : master
76- - deploy :
77- requires :
78- - build
79- filters :
80- branches :
81- only : master
36+ - build
You can’t perform that action at this time.
0 commit comments