From 7d03396e1ce7d8d2a0c1ebe64f537b934830ff7f Mon Sep 17 00:00:00 2001 From: t_max <1172915550@qq.com> Date: Mon, 29 Jan 2024 11:28:43 +0800 Subject: [PATCH] ci: codecov --- .github/workflows/go.yml | 14 ++++++++++---- .github/workflows/push.yml | 16 +++++++++++----- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1284c07..5acf315 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -136,8 +136,6 @@ jobs: - name: checkout uses: actions/checkout@v3 - with: - path: 'driver-go' - name: prepare install run: sudo apt install -y libgeos-dev @@ -163,7 +161,15 @@ jobs: uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - cache-dependency-path: driver-go/go.sum + cache-dependency-path: go.sum - name: Test - run: cd ./driver-go && go test -v ./... + run: sudo go test -v --count=1 -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage to Codecov + if: ${{ matrix.go }} == '1.20' + uses: codecov/codecov-action@v4-beta + with: + files: ./coverage.txt + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 35d1d97..47d94ec 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -82,7 +82,7 @@ jobs: needs: build strategy: matrix: - go: [ '1.14', '1.19' ] + go: [ '1.14', 'stable' ] name: Go ${{ matrix.go }} steps: - name: get cache server @@ -96,8 +96,6 @@ jobs: - name: checkout uses: actions/checkout@v3 - with: - path: 'driver-go' - name: prepare install run: sudo apt install -y libgeos-dev @@ -123,7 +121,15 @@ jobs: uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - cache-dependency-path: driver-go/go.sum + cache-dependency-path: go.sum - name: Test - run: cd ./driver-go && go test -v ./... + run: sudo go test -v --count=1 -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage to Codecov + if: ${{ matrix.go }} == 'stable' + uses: codecov/codecov-action@v4-beta + with: + files: ./coverage.txt + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}