From d141af34aafb159ed0cd0c764757238489041145 Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Mon, 4 Nov 2024 11:12:40 +0700 Subject: [PATCH 1/2] add coverage flow --- .github/workflows/coverage.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..aa40cc42 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,32 @@ +name: Code Coverage + +on: + pull_request: + +jobs: + test-and-coverage: + runs-on: ubuntu-latest + + steps: + - name: Check out the code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Install dependencies + run: go mod download + + - name: Run tests with coverage + run: | + mkdir -p coverage + go test -v -coverpkg=./... -coverprofile=coverage/coverage.out -covermode=atomic ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: ./coverage/coverage.out + flags: cosmos + fail_ci_if_error: true \ No newline at end of file From 228780ef01e38bee349309dfcd6c9b86f8fe8d3f Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Mon, 4 Nov 2024 11:25:52 +0700 Subject: [PATCH 2/2] rm upload --- .github/workflows/coverage.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index aa40cc42..c73d3815 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,10 +23,3 @@ jobs: run: | mkdir -p coverage go test -v -coverpkg=./... -coverprofile=coverage/coverage.out -covermode=atomic ./... - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: ./coverage/coverage.out - flags: cosmos - fail_ci_if_error: true \ No newline at end of file