Skip to content

Commit

Permalink
codecov ubuntu & mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Miller committed Dec 29, 2021
1 parent 0c845d8 commit 92dc795
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codecov-coverage-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -57,12 +57,12 @@ jobs:
# Run Tests and Coverage
- name: Run coverage
run: |
go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic || true
go test ./... -v -race -coverprofile=./coverage/${{ runner.os }}-coverage.txt -covermode=atomic || true
- name: Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
file: ./coverage/${{ runner.os }}-coverage.txt
env_vars: OS,GOVERSION
verbose: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
![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)
[![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)
[![codecov](https://codecov.io/gh/mr-pmillz/pimp-my-shell/branch/master/graph/badge.svg?token=8NOCNMK0OE)](https://codecov.io/gh/mr-pmillz/pimp-my-shell)

Table of Contents
=================
Expand Down
15 changes: 13 additions & 2 deletions localio/localio.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@ func RunCommandPipeOutput(command string) error {
return err
}

stderr, err := cmd.StderrPipe()
if err != nil {
return err
}

errScanner := bufio.NewScanner(stderr)
go func() {
for errScanner.Scan() {
fmt.Printf("%s\n", errScanner.Text())
}
}()

scanner := bufio.NewScanner(stdout)
go func() {
for scanner.Scan() {
Expand All @@ -443,8 +455,7 @@ func RunCommandPipeOutput(command string) error {
return err
}

err = cmd.Wait()
if err != nil {
if err = cmd.Wait(); err != nil {
fmt.Fprintf(os.Stderr, "Error waiting for Cmd %s\n", err)
return err
}
Expand Down
5 changes: 5 additions & 0 deletions vim/vim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ func TestInstallVimPlugins(t *testing.T) {
osType string
dirs *localio.Directories
}
if val, _ := os.LookupEnv("GITHUB_ACTIONS"); val == "true" {
if err = localio.RunCommandPipeOutput(fmt.Sprintf("rm -rf %s/.vim_runtime 2>/dev/null || true", dirs.HomeDir)); err != nil {
t.Errorf("couldn't remove ~/.vim_runtime dir. error = %v", err)
}
}
tests := []struct {
name string
args args
Expand Down

0 comments on commit 92dc795

Please sign in to comment.