Skip to content

Commit

Permalink
Merge pull request #4 from softlayer/tests
Browse files Browse the repository at this point in the history
#3 fixed a typo
  • Loading branch information
allmightyspiff authored Apr 9, 2020
2 parents 3c9f13d + 0d4fd56 commit d7f7e78
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,52 @@ on:
branches: [ master ]

jobs:
test:
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v1
- name: Run tests
run: |
go get -v -t -d ./...
go test -v -covermode=count
coverage:
runs-on: ubuntu-latest
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v1
with:
go-version: 1.14.x
- name: Checkout code
uses: actions/checkout@v1
- name: Calc coverage
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go get -v -t -d ./...
go test -v . -covermode=count -coverprofile=coverage.out
# Required because the coverage.out file on github actions has a path that breaks gcov2lcov
sed -i "s/$(pwd|sed 's/\//\\\//g')/./g" coverage.out
- name: Convert coverage to lcov
uses: jandelgado/[email protected]
with:
infile: coverage.out
outfile: coverage.lcov
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov

build:
name: Build
Expand All @@ -32,6 +78,3 @@ jobs:
- name: Build
run: go build -v .

- test: Test
run: go test -v .

0 comments on commit d7f7e78

Please sign in to comment.