Skip to content

Commit

Permalink
ci: codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
huskar-t committed Jan 29, 2024
1 parent 6f95553 commit 7d03396
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
16 changes: 11 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}

0 comments on commit 7d03396

Please sign in to comment.