Skip to content

Commit

Permalink
(ci) coveritup metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Aug 22, 2023
1 parent 95a341a commit 46f21db
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 5 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/coveritup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on: [push, pull_request]
name: CoverItUp
jobs:
CoverItUp:
strategy:
matrix:
go-version: [dev-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: kevincobain2000/action-gobrew@v2
with:
version: ${{ matrix.go-version }}
- name: Test
run: go test -race -v ./... -count=1 -coverprofile=coverage.out

- name: Coverage
run: |
go tool cover -html=coverage.out -o coverage.html
gocov convert coverage.out | gocov-xml > coverage.xml
- name: Build
run: go build -ldflags '-s -w' -o main cmd/gobrew/main.go

# Coveritup
- name: Coveritup
run: |
curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh
echo SCORE=`./cover-totalizer coverage.xml` >> "$GITHUB_ENV"
- uses: kevincobain2000/action-coveritup@v1
with:
type: coverage

- name: Go Binary Size
run: |
echo SCORE=`du -sk main | awk '{print $1}'` >> "$GITHUB_ENV"
- uses: kevincobain2000/action-coveritup@v1
with:
type: go-binary-size

- name: Number of dependencies
run: |
echo SCORE=`go list -m all|wc -l|awk '{$1=$1};1'` >> "$GITHUB_ENV"
- uses: kevincobain2000/action-coveritup@v1
with:
type: go-mod-dependencies

- uses: kevincobain2000/action-coveritup@v1
with:
pr_comment: true
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@

# Build Status

| Branch | Status |
| :------ | :----------------------------------------------------------------------------------------- |
| master | ![Test](https://github.com/kevincobain2000/gobrew/workflows/Test/badge.svg?branch=master) |
| develop | ![Test](https://github.com/kevincobain2000/gobrew/workflows/Test/badge.svg?branch=develop) |
| Coverage | [![codecov](https://codecov.io/gh/kevincobain2000/gobrew/branch/master/graph/badge.svg)](https://codecov.io/gh/kevincobain2000/gobrew) |
| Branch | Status |
|:----------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| master | ![Test](https://github.com/kevincobain2000/gobrew/workflows/Test/badge.svg?branch=master) |
| Coverage | [![coveritup](https://coveritup.app/embed?org=kevincobain2000&repo=gobrew&branch=master&type=coverage)](https://coveritup.app/kevincobain2000/gobrew) |
| Binary Size | [![coveritup](https://coveritup.app/embed?org=kevincobain2000&repo=gobrew&branch=master&type=go-binary-size)](https://coveritup.app/kevincobain2000/gobrew) |
| Mod Dependecies | [![coveritup](https://coveritup.app/embed?org=kevincobain2000&repo=gobrew&branch=master&type=go-mod-depdendencies)](https://coveritup.app/kevincobain2000/gobrew) |



## Install or update
Expand Down

0 comments on commit 46f21db

Please sign in to comment.