File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 DOCKER_REPOSITORY : marcofontana17/cce_prototipo
1515
1616jobs :
17+ test :
18+ runs-on : ubuntu-latest
19+ name : Run Tests
20+
21+ steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v4
24+
25+ - name : Set up Go
26+ uses : actions/setup-go@v5
27+ with :
28+ go-version : ' 1.24'
29+ check-latest : true
30+
31+ - name : Cache Go modules
32+ uses : actions/cache@v4
33+ with :
34+ path : |
35+ ~/.cache/go-build
36+ ~/go/pkg/mod
37+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
38+ restore-keys : |
39+ ${{ runner.os }}-go-
40+
41+ - name : Download dependencies
42+ run : go mod download
43+
44+ - name : Verify dependencies
45+ run : go mod verify
46+
47+ - name : Run tests
48+ run : go test -v ./...
49+
50+ - name : Run tests with race detector
51+ run : go test -race -short ./...
52+
53+ - name : Run tests with coverage
54+ run : go test -coverprofile=coverage.out ./...
55+
56+ - name : Display coverage report
57+ run : go tool cover -func=coverage.out
58+
59+ - name : Check test coverage threshold
60+ run : |
61+ COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')
62+ echo "Total coverage: ${COVERAGE}%"
63+
64+ # - name: Upload coverage to Codecov (optional)
65+ # uses: codecov/codecov-action@v4
66+ # with:
67+ # file: ./coverage.out
68+ # flags: unittests
69+ # name: codecov-umbrella
70+ # continue-on-error: true
71+
1772 build-and-push :
1873 runs-on : ubuntu-latest
1974 name : Build and Push Docker Images
75+ needs : test
2076
2177 strategy :
2278 matrix :
You can’t perform that action at this time.
0 commit comments