1- # Use the latest 2.1 version of CircleCI pipeline process engine.
2- # See: https://circleci.com/docs/2.0/configuration-reference
31version : 2.1
4-
5- # Define a job to be invoked later in a workflow.
6- # See: https://circleci.com/docs/2.0/configuration-reference/#jobs
72jobs :
83 build :
9- working_directory : ~/repo
10- # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
11- # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
124 docker :
13- - image : circleci/golang:1.17
14- # Add steps to the job
15- # See: https://circleci.com/docs/2.0/configuration-reference/#steps
5+ - image : circleci/golang:latest
6+
7+ working_directory : /go/src/github.com/gopulse/pulse
8+
169 steps :
1710 - checkout
18- - restore_cache :
19- keys :
20- - go-mod-v4-{{ checksum "go.sum" }}
11+
12+ # Install dependencies
2113 - run :
2214 name : Install Dependencies
23- command : go mod download
24- - save_cache :
25- key : go-mod-v4-{{ checksum "go.sum" }}
26- paths :
27- - " /go/pkg/mod"
15+ command : |
16+ go mod download
17+
18+ # Build and test
2819 - run :
29- name : Run tests
20+ name : Build and Test
3021 command : |
31- mkdir -p /tmp/test-reports
32- gotestsum --junitfile /tmp/test-reports/unit-tests.xml -timeout 20m
33- - store_test_results :
34- path : /tmp/test-reports
22+ go build -v ./...
23+ go test -timeout=5m -v ./...
24+
25+ # Upload coverage report
26+ - run :
27+ name : Upload Coverage Report
28+ command : |
29+ bash <(curl -s https://codecov.io/bash) -f coverage.out -t $CODECOV_TOKEN
3530
36- # Invoke jobs via workflows
37- # See: https://circleci.com/docs/2.0/configuration-reference/#workflows
3831workflows :
39- sample : # This is the name of the workflow, feel free to change it to better match your workflow.
40- # Inside the workflow, you define the jobs you want to run.
32+ version : 2
33+ build :
4134 jobs :
42- - build
35+ - build
0 commit comments