Skip to content

Commit c204fab

Browse files
committed
update to use new CodeCov API
1 parent 27b96c2 commit c204fab

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.github/workflows/go.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,25 @@ jobs:
2424
- name: Build
2525
run: go build -v ./...
2626

27-
- name: Test
28-
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
29-
3027
- name: govulncheck
3128
uses: golang/govulncheck-action@v1
3229
with:
3330
go-version-input: 1.21
3431
go-package: ./...
3532

36-
- shell: bash
33+
- name: Test
34+
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
35+
36+
- name: Codecov upload coverage
37+
shell: bash
3738
env:
3839
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
40+
RUN_ID: ${{ github.run_id }}
3941
run: |
4042
# Replace `linux` below with the appropriate OS
4143
# Options are `alpine`, `linux`, `macos`, `windows`
4244
# You will need to setup the environment variables below in github
4345
# and the project in codecov.io
44-
go test -v -coverprofile=coverage.txt -covermode=atomic ./...
4546
curl -Os https://uploader.codecov.io/latest/linux/codecov
4647
chmod +x codecov
47-
CODECOV_TOKEN=$CODECOV_TOKEN ./codecov
48+
./codecov --verbose upload-process --fail-on-error -t $CODECOV_TOKEN -n 'service'-$RUN_ID -F service -f coverage-service.xml

cmd/hello-world/main.go

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package main
2+
3+
import (
4+
"os"
5+
)
6+
7+
func main() {
8+
os.Stdout.WriteString("Hello world!\n")
9+
}

0 commit comments

Comments
 (0)