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

Run tests with Github Actions #61

Merged
merged 2 commits into from
Sep 17, 2021
Merged

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Aug 26, 2021

This PR adds support for running tests with Github Actions as the Travis CI job does not seem to be enabled.

@pdecat
Copy link
Contributor Author

pdecat commented Aug 26, 2021

Github Actions test workflow is now working and picking up build errors because mongodb dependencies introduced by #53 are not vendored:

pagerduty/cache.go:13:2: cannot find package "go.mongodb.org/mongo-driver/bson" in any of:
	/home/runner/work/go-pagerduty/go-pagerduty/src/github.com/heimweh/go-pagerduty/vendor/go.mongodb.org/mongo-driver/bson (vendor tree)
	/opt/hostedtoolcache/go/1.16.7/x64/src/go.mongodb.org/mongo-driver/bson (from $GOROOT)
	/home/runner/work/go-pagerduty/go-pagerduty/src/go.mongodb.org/mongo-driver/bson (from $GOPATH)
pagerduty/cache.go:14:2: cannot find package "go.mongodb.org/mongo-driver/bson/primitive" in any of:
	/home/runner/work/go-pagerduty/go-pagerduty/src/github.com/heimweh/go-pagerduty/vendor/go.mongodb.org/mongo-driver/bson/primitive (vendor tree)
	/opt/hostedtoolcache/go/1.16.7/x64/src/go.mongodb.org/mongo-driver/bson/primitive (from $GOROOT)
	/home/runner/work/go-pagerduty/go-pagerduty/src/go.mongodb.org/mongo-driver/bson/primitive (from $GOPATH)
pagerduty/cache.go:15:2: cannot find package "go.mongodb.org/mongo-driver/mongo" in any of:
	/home/runner/work/go-pagerduty/go-pagerduty/src/github.com/heimweh/go-pagerduty/vendor/go.mongodb.org/mongo-driver/mongo (vendor tree)
	/opt/hostedtoolcache/go/1.16.7/x64/src/go.mongodb.org/mongo-driver/mongo (from $GOROOT)
	/home/runner/work/go-pagerduty/go-pagerduty/src/go.mongodb.org/mongo-driver/mongo (from $GOPATH)
pagerduty/cache.go:16:2: cannot find package "go.mongodb.org/mongo-driver/mongo/options" in any of:
	/home/runner/work/go-pagerduty/go-pagerduty/src/github.com/heimweh/go-pagerduty/vendor/go.mongodb.org/mongo-driver/mongo/options (vendor tree)
	/opt/hostedtoolcache/go/1.16.7/x64/src/go.mongodb.org/mongo-driver/mongo/options (from $GOROOT)
	/home/runner/work/go-pagerduty/go-pagerduty/src/go.mongodb.org/mongo-driver/mongo/options (from $GOPATH)
pagerduty/cache.go:17:2: cannot find package "go.mongodb.org/mongo-driver/mongo/readpref" in any of:
	/home/runner/work/go-pagerduty/go-pagerduty/src/github.com/heimweh/go-pagerduty/vendor/go.mongodb.org/mongo-driver/mongo/readpref (vendor tree)
	/opt/hostedtoolcache/go/1.16.7/x64/src/go.mongodb.org/mongo-driver/mongo/readpref (from $GOROOT)
	/home/runner/work/go-pagerduty/go-pagerduty/src/go.mongodb.org/mongo-driver/mongo/readpref (from $GOPATH)

https://github.com/pdecat/go-pagerduty/runs/3430412065?check_suite_focus=true#step:4:17

Also, what about switching from govendor to go modules to manage dependencies?

- name: Checkout
uses: actions/checkout@v2
with:
path: src/github.com/heimweh/go-pagerduty/
Copy link
Contributor Author

@pdecat pdecat Aug 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See actions/setup-go#102 (comment) for why this is needed.

Copy link
Owner

@heimweh heimweh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @pdecat! This looks great 🎉

Let's merge this one and switch to go modules while we're at it so we can fix the dep issues 👍

@heimweh heimweh merged commit 0fa2c22 into heimweh:master Sep 17, 2021
@pdecat pdecat deleted the github-actions branch September 17, 2021 22:22
stmcallister pushed a commit that referenced this pull request Oct 21, 2021
* Run tests with Github Actions

* Fix Github Actions test workflow by setting GOPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants