Skip to content

Commit

Permalink
Merge pull request #754 from 99designs/coveralls
Browse files Browse the repository at this point in the history
Add coveralls
  • Loading branch information
vektah committed Jun 24, 2019
2 parents f4a69ab + f28ed26 commit ba176e2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
docker build -f .circleci/golang.Dockerfile -t gqlgen/golang .
docker build -f .circleci/node.Dockerfile -t gqlgen/node .
- run:
name: "coverage"
command: docker run -e REPOTOKEN --rm gqlgen/golang .circleci/coverage.sh

- run:
name: "golang tests"
command: docker run --rm gqlgen/golang .circleci/test.sh
Expand Down
6 changes: 6 additions & 0 deletions .circleci/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -eu

go test -coverprofile=/tmp/coverage.out -coverpkg=./... $(go list github.com/99designs/gqlgen/... | grep -v server)
goveralls -coverprofile=/tmp/coverage.out -service=circle-ci -repotoken=$REPOTOKEN -ignore='example/*/*,example/*/*/*,integration/*,integration/*/*,codegen/testserver/*'
1 change: 1 addition & 0 deletions .circleci/golang.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM golang:1.11

RUN curl -sL --fail https://github.com/golangci/golangci-lint/releases/download/v1.13/golangci-lint-1.13-linux-amd64.tar.gz | tar zxv --strip-components=1 --dir=/go/bin
RUN go get github.com/mattn/goveralls

WORKDIR /projects/gqlgen

Expand Down
16 changes: 0 additions & 16 deletions cmd/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/99designs/gqlgen/api"
"github.com/99designs/gqlgen/codegen/config"
"github.com/99designs/gqlgen/plugin/modelgen"
"github.com/pkg/errors"
"github.com/urfave/cli"
)
Expand Down Expand Up @@ -43,18 +42,3 @@ var genCmd = cli.Command{
}
},
}

func main() {
cfg, err := config.LoadConfigFromDefaultLocations()
if os.IsNotExist(errors.Cause(err)) {
cfg = config.DefaultConfig()
} else if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(2)
}

err = modelgen.New().(*modelgen.Plugin).MutateConfig(cfg)
if err != nil {
panic(err)
}
}

0 comments on commit ba176e2

Please sign in to comment.