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

Test with docker - make test #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test:
docker-compose run --rm test make _test

_test:
go test -v -race ./...
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,21 @@ fmt.Printf("Added a %v reaction to subject with ID %#v!\n", m.AddReaction.Reacti
// Added a HOORAY reaction to subject with ID "MDU6SXNzdWUyMTc5NTQ0OTc="!
```

Test
----

You need to have [docker-compose](https://docs.docker.com/compose/) and [make](https://www.gnu.org/software/make/manual/make.html) in order to run the tests inside a container.

```text
make test
```

You can run the target as well directly on your machine without docker.

```text
make _test
```

Directories
-----------

Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'

services:
test:
image: golang
volumes:
- ${PWD}:/src
- ${HOME}/.cache/go-build:/go/pkg/mod
working_dir: /src
environment:
- GOCACHE=/go/pkg/mod
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/shurcooL/githubv4

go 1.16

require (
github.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
)