Skip to content

Commit

Permalink
use Codecov instead of Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Miller committed Dec 29, 2021
1 parent c32060b commit ca9f2ce
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 103 deletions.
78 changes: 0 additions & 78 deletions .github/workflows/codacy-coverage-reporter.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/codecov-coverage-reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Codecov

on:
push:
tags:
- '*'
pull_request:

jobs:
coverage-reporter:
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

# Setup Go
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- id: go-cache-paths
run: |
echo "::set-output name=gobuild::$(go env GOCACHE)"
echo "::set-output name=gomod::$(go env GOMODCACHE)"
# Cache go build cache
- name: Go Build Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.gobuild }}
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/go.sum') }}

# Cache go mod cache
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.gomod }}
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}

# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos [Ubuntu]
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-18.04'

# Run build of the application
- name: Run build
run: |
make -f MakeFile build
# Run Tests and Coverage
- name: Run coverage
run: go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic

- name: Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
env_vars: OS,GOVERSION
verbose: true
48 changes: 24 additions & 24 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ jobs:

- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
echo "::set-output name=gobuild::$(go env GOCACHE)"
echo "::set-output name=gomod::$(go env GOMODCACHE)"
# Cache go build cache
- name: Go Build Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
path: ${{ steps.go-cache-paths.outputs.gobuild }}
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/go.sum') }}

# Cache go mod cache
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
path: ${{ steps.go-cache-paths.outputs.gomod }}
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}

- name: Install dependencies
run: go get github.com/mattn/go-isatty@v0.0.12
Expand All @@ -66,22 +66,22 @@ jobs:

- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
echo "::set-output name=gobuild::$(go env GOCACHE)"
echo "::set-output name=gomod::$(go env GOMODCACHE)"
# Cache go build cache
- name: Go Build Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
path: ${{ steps.go-cache-paths.outputs.gobuild }}
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/go.sum') }}

# Cache go mod cache
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
path: ${{ steps.go-cache-paths.outputs.gomod }}
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}

- name: Install dependencies
run: go get github.com/mattn/go-isatty@v0.0.12
Expand Down Expand Up @@ -118,22 +118,22 @@ jobs:

- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
echo "::set-output name=gobuild::$(go env GOCACHE)"
echo "::set-output name=gomod::$(go env GOMODCACHE)"
# Cache go build cache
- name: Go Build Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
path: ${{ steps.go-cache-paths.outputs.gobuild }}
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/go.sum') }}

# Cache go mod cache
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
path: ${{ steps.go-cache-paths.outputs.gomod }}
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}

- name: Go Build
run: |
Expand Down Expand Up @@ -196,22 +196,22 @@ jobs:

- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
echo "::set-output name=gobuild::$(go env GOCACHE)"
echo "::set-output name=gomod::$(go env GOMODCACHE)"
# Cache go build cache
- name: Go Build Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
path: ${{ steps.go-cache-paths.outputs.gobuild }}
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/go.sum') }}

# Cache go mod cache
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
path: ${{ steps.go-cache-paths.outputs.gomod }}
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}

- name: Install dependencies
run: go get github.com/mattn/go-isatty@v0.0.12
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ bin/*
*.html
*.xml
coverage/*
coverage.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
![GitHub release (latest by date)](https://img.shields.io/github/v/release/mr-pmillz/pimp-my-shell?style=plastic)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/mr-pmillz/pimp-my-shell?style=plastic)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fmr-pmillz%2Fpimp-my-shell)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fmr-pmillz%2Fpimp-my-shell)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/cffe102aadbd4f4394754f0c259cc527)](https://www.codacy.com/gh/mr-pmillz/pimp-my-shell/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mr-pmillz/pimp-my-shell&utm_campaign=Badge_Coverage)
[![CI](https://github.com/mr-pmillz/pimp-my-shell/actions/workflows/go.yml/badge.svg)](https://github.com/mr-pmillz/pimp-my-shell/actions/workflows/go.yml)
[![codecov](https://codecov.io/gh/mr-pmillz/pimp-my-shell/branch/master/graph/badge.svg)](https://codecov.io/gh/mr-pmillz/pimp-my-shell)

Table of Contents
=================
Expand Down

0 comments on commit ca9f2ce

Please sign in to comment.