Skip to content

Commit

Permalink
update to use new CodeCov API
Browse files Browse the repository at this point in the history
  • Loading branch information
soypat committed Dec 21, 2024
1 parent 27b96c2 commit c204fab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,25 @@ jobs:
- name: Build
run: go build -v ./...

- name: Test
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...

- name: govulncheck
uses: golang/govulncheck-action@v1
with:
go-version-input: 1.21
go-package: ./...

- shell: bash
- name: Test
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...

- name: Codecov upload coverage
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
RUN_ID: ${{ github.run_id }}
run: |
# Replace `linux` below with the appropriate OS
# Options are `alpine`, `linux`, `macos`, `windows`
# You will need to setup the environment variables below in github
# and the project in codecov.io
go test -v -coverprofile=coverage.txt -covermode=atomic ./...
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
CODECOV_TOKEN=$CODECOV_TOKEN ./codecov
./codecov --verbose upload-process --fail-on-error -t $CODECOV_TOKEN -n 'service'-$RUN_ID -F service -f coverage-service.xml
9 changes: 9 additions & 0 deletions cmd/hello-world/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"os"
)

func main() {
os.Stdout.WriteString("Hello world!\n")
}

0 comments on commit c204fab

Please sign in to comment.