From e3ed68fc6ce864b577405e5281ddabd5d92ca9a4 Mon Sep 17 00:00:00 2001 From: sincos Date: Mon, 19 Feb 2024 15:31:21 +0800 Subject: [PATCH] chore(workflows): update codecov.yaml --- .github/workflows/codecov.yaml | 50 ++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index 71fcf2f0..2880eaa0 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -1,5 +1,45 @@ -- name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - env: - token: ${{ secrets.CODECOV_TOKEN }} - slug: machinefi/sprout +name: Codecov +on: + push: + branches: [ "develop", "pull-request" ] + pull_request: + branches: [ "develop", "pull-request" ] + +jobs: + + test: + name: Codecov + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: 1.21 + + - name: Check out code + uses: actions/checkout@v1 + + - name: Run Unit tests. + run: go test ./... -coverprofile cover.out -covermode=atomic + + - name: Upload Coverage report to CodeCov + uses: codecov/codecov-action@v1.0.0 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ./cover.out + + #build: + # name: Build + # runs-on: ubuntu-latest + # needs: [lint, test] + # steps: + # - name: Set up Go + # uses: actions/setup-go@v1 + # with: + # go-version: 1.12 + + # - name: Check out code + # uses: actions/checkout@v1 + + # - name: Build + # run: make build \ No newline at end of file