Skip to content

Commit

Permalink
Add script to migrate and insert repositories coverage stats
Browse files Browse the repository at this point in the history
  • Loading branch information
calj committed Nov 25, 2022
1 parent afe8918 commit 0772c2e
Show file tree
Hide file tree
Showing 5 changed files with 406 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage.xml
.env
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Go Coverage

This tool is used to export summary of XML coverage report into a SQL database.

## Usage

```bash
export ANALYTICS_DATABASE_HOST="localhost"
export ANALYTICS_DATABASE_PORT="5433"
export ANALYTICS_DATABASE_USERNAME="postgres"
export ANALYTICS_DATABASE_PASSWORD=""
export ANALYTICS_DATABASE_NAME="analytics"
export DRONE_REPO="openware/go-coverage"
export ANALYTICS_COMPONENT="go-coverage" # use it to differenciate different applications in a mono-repo.
export DRONE_TAG="1.0.0" # trigger this script on drone tag to track only stable versions

go run ./ coverage.xml
```
24 changes: 24 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module github.com/openware/go-coverage

go 1.19

require (
github.com/antchfx/xmlquery v1.3.13 // indirect
github.com/antchfx/xpath v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.13.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.12.0 // indirect
github.com/jackc/pgx/v4 v4.17.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.4 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/text v0.3.7 // indirect
gorm.io/driver/postgres v1.4.5 // indirect
gorm.io/gorm v1.24.2 // indirect
)
Loading

0 comments on commit 0772c2e

Please sign in to comment.