-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from badgerodon/ci-test
fix tests, add coveralls
- Loading branch information
Showing
10 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Test | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
test: | ||
name: Go | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16.6' | ||
|
||
- id: go-cache-paths | ||
run: | | ||
echo "::set-output name=go-build::$(go env GOCACHE)" | ||
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache go build | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-build }} | ||
key: ${{ runner.os }}-go-build | ||
|
||
- name: Cache go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-mod }} | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-mod- | ||
- name: Pull test docker images | ||
run: | | ||
docker pull fixl/google-cloud-sdk-emulators:349.0.0-pubsub | ||
- name: Download go modules | ||
run: | | ||
go mod download | ||
- name: Run tests | ||
run: | | ||
go test -race -covermode atomic -coverprofile=covprofile ./... | ||
- name: Send coverage | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
go run github.com/mattn/goveralls -coverprofile=covprofile -service=github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//+build tools | ||
|
||
package pubsub | ||
|
||
import ( | ||
_ "github.com/mattn/goveralls" // used for code coverage | ||
) |