11name : Run Tests
2-
32on : [push, pull_request]
4-
53jobs :
64 test :
5+ name : Test with Coverage
76 runs-on : ubuntu-latest
8-
97 steps :
10- - name : Checkout code
11- uses : actions/checkout@v4
12-
13- - name : Set up Go
14- uses : actions/setup-go@v5
15- with :
16- go-version : ' 1.24' # Specify your desired Go version
17-
18- - name : Download Go modules
19- run : go mod tidy
20-
21- - name : Run Go tests
22- run : go test -json -cover -coverprofile coverage.out -v ./... # -v for verbose output, ./... to run all tests in subdirectories
23-
24- - name : Upload coverage reports to Codecov
25- uses : codecov/codecov-action@v5
26- with :
27- files : ./coverage.out
28- token : ${{ secrets.CODECOV_TOKEN }}
29- slug : hackafterdark/carta
8+ - name : Set up Go
9+ uses : actions/setup-go@v2
10+ with :
11+ go-version : ' 1.24'
12+ - name : Check out code
13+ uses : actions/checkout@v2
14+ - name : Install dependencies
15+ run : |
16+ go mod download
17+ - name : Run Unit tests
18+ run : |
19+ go test -race -covermode atomic -coverprofile=coverage.out -v ./...
20+ - name : Install goveralls
21+ run : go install github.com/mattn/goveralls@latest
22+ - name : Send coverage
23+ env :
24+ COVERALLS_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
25+ run : goveralls -coverprofile=coverage.out -service=github
26+ # or use shogo82148/actions-goveralls
27+ # - name: Send coverage
28+ # uses: shogo82148/actions-goveralls@v1
29+ # with:
30+ # path-to-profile: covprofile
31+ # Not sure why Codecov broke... leaving it for now but will probably need to remove it
32+ - name : Upload coverage reports to Codecov
33+ uses : codecov/codecov-action@v5
34+ with :
35+ files : ./coverage.out
36+ token : ${{ secrets.CODECOV_TOKEN }}
37+ slug : hackafterdark/carta
0 commit comments