Skip to content

Commit

Permalink
add token to codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
creativeprojects committed Jun 15, 2024
1 parent ecbc0eb commit 0e5ed1c
Showing 1 changed file with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,38 @@ jobs:

steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go_version }}
check-latest: true
cache: true

- name: Get dependencies
run: |
go mod download
- name: Build
run: go build -v ./...

- name: Test
shell: bash
run: |
if [[ "${GITHUB_TOKEN}" != "" ]]; then
go test -v -race -coverprofile=coverage.txt . ./update
else
go test -v -race -short -coverprofile=coverage.txt . ./update
fi
- name: Code coverage with codecov
uses: codecov/codecov-action@v4
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go_version }}
check-latest: true
cache: true

- name: Get dependencies
run: |
go mod download
- name: Build
run: go build -v ./...

- name: Test
shell: bash
run: |
if [[ "${GITHUB_TOKEN}" != "" ]]; then
go test -v -race -coverprofile=coverage.txt . ./update
else
go test -v -race -short -coverprofile=coverage.txt . ./update
fi
- name: Code coverage with codecov
uses: codecov/codecov-action@v4
with:
env_vars: OS,GO
file: ./coverage.txt
flags: unittests
fail_ci_if_error: false
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 0e5ed1c

Please sign in to comment.