From 0e5ed1c738a9b3689abc23f7369b774676cd6ff4 Mon Sep 17 00:00:00 2001 From: Fred Date: Sat, 15 Jun 2024 22:09:55 +0100 Subject: [PATCH] add token to codecov --- .github/workflows/build.yml | 63 ++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 406a87d..b42625d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }}