Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Github Actions #116

Merged
merged 3 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
on: [push, pull_request]
name: CI
jobs:
test:
build:
strategy:
matrix:
go-version: [latest, dev-latest, mod]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: kevincobain2000/action-gobrew@v2
- uses: kevincobain2000/action-gobrew@v2.2
with:
version: ${{ matrix.go-version }}

Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/coveritup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on: [push, pull_request]
name: Cover It Up
jobs:
coveritup:
strategy:
matrix:
go-version: [latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: kevincobain2000/action-gobrew@v2.2
with:
version: ${{ matrix.go-version }}

- name: Install Tools
run: |
go install github.com/axw/gocov/gocov@latest
go install github.com/AlekSi/gocov-xml@latest
- 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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: [push, pull_request]
on: [pull_request]
name: CI
jobs:
test:
Expand All @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: kevincobain2000/action-gobrew@v2
- uses: kevincobain2000/action-gobrew@v2.2
with:
version: ${{ matrix.go-version }}
- name: Test
Expand Down
14 changes: 8 additions & 6 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 Expand Up @@ -248,7 +250,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: kevincobain2000/action-gobrew@v2.1
- uses: kevincobain2000/action-gobrew@v2.2
with:
version: ${{ matrix.go-version }}

Expand Down