Skip to content

Commit 0ca10b0

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

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/go.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@ 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`
@@ -44,4 +46,4 @@ jobs:
4446
go test -v -coverprofile=coverage.txt -covermode=atomic ./...
4547
curl -Os https://uploader.codecov.io/latest/linux/codecov
4648
chmod +x codecov
47-
CODECOV_TOKEN=$CODECOV_TOKEN ./codecov
49+
./codecov --verbose upload-process --fail-on-error -t $CODECOV_TOKEN -n 'service'-$RUN_ID -F service -f coverage.txt

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)