-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into schemaconfig-plugin
- Loading branch information
Showing
66 changed files
with
9,195 additions
and
2,440 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
go get github.com/mattn/goveralls | ||
|
||
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/*' |
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,10 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
go fmt ./... | ||
if [[ $(git --no-pager diff) ]] ; then | ||
echo "you need to run "go fmt" and commit the changes" | ||
git --no-pager diff | ||
exit 1 | ||
fi |
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,11 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
go generate ./... | ||
|
||
if [[ $(git --no-pager diff) ]] ; then | ||
echo "you need to run "go generate ./..." and commit the changes" | ||
git --no-pager diff | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -1,17 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
set -euo pipefail | ||
|
||
cd integration | ||
|
||
go run ./server/server.go & | ||
|
||
sleep 2 | ||
|
||
echo "### running jest integration spec" | ||
./node_modules/.bin/jest --color | ||
|
||
|
||
echo "### validating introspected schema" | ||
./node_modules/.bin/graphql get-schema | ||
SERVER_URL=http://localhost:8080/query ./node_modules/.bin/graphql get-schema | ||
|
||
if ! diff <(tail -n +3 schema-expected.graphql) <(tail -n +3 schema-fetched.graphql) ; then | ||
echo "The expected schema has changed, you need to update schema-expected.graphql with any expected changes" | ||
exit 1 | ||
fi | ||
|
||
|
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 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
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 | ||
|
||
golangci-lint run |
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 |
---|---|---|
@@ -1,48 +1,47 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
working_directory: /app | ||
lint: | ||
docker: | ||
- image: docker:18 | ||
- image: circleci/golang:1.12 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- run: | ||
name: "docker build" | ||
command: | | ||
docker build -f .circleci/golang.Dockerfile -t gqlgen/golang . | ||
docker build -f .circleci/node.Dockerfile -t gqlgen/node . | ||
- run: go mod download | ||
- run: .circleci/check-fmt | ||
- run: .circleci/check-linting | ||
- run: .circleci/check-generate | ||
|
||
- run: | ||
name: "golang tests" | ||
command: docker run --rm gqlgen/golang .circleci/test.sh | ||
|
||
- run: | ||
name: "integration tests" | ||
command: | | ||
function cleanup { | ||
echo "Cleaning up containers..." | ||
docker kill $SERVER_CONTAINER 1>/dev/null 2>/dev/null || true | ||
docker rm --force -v $SERVER_CONTAINER 1>/dev/null 2>/dev/null || true | ||
} | ||
trap cleanup EXIT | ||
SERVER_CONTAINER=$(docker run -d \ | ||
-e PORT=1234 \ | ||
--name integration_server \ | ||
gqlgen/golang go run ./integration/server/server.go \ | ||
) | ||
sleep 20 | ||
docker run \ | ||
-e SERVER_URL=http://integration_server:1234/query \ | ||
--link=integration_server \ | ||
gqlgen/node ../.circleci/integration.sh | ||
test: | ||
docker: | ||
- image: circleci/golang:1.12 | ||
steps: | ||
- checkout | ||
- run: go mod download | ||
- run: go test -race ./... | ||
|
||
echo "### server logs" | ||
docker logs $SERVER_CONTAINER | ||
cover: | ||
docker: | ||
- image: circleci/golang:1.12 | ||
steps: | ||
- checkout | ||
- run: go mod download | ||
- run: .circleci/check-coverage | ||
|
||
exit $(docker inspect $SERVER_CONTAINER --format='{{.State.ExitCode}}') | ||
integration: | ||
docker: | ||
- image: alpine:3.10 | ||
steps: | ||
- checkout | ||
- run: apk add --no-cache --no-progress nodejs npm go musl-dev git bash | ||
- run: go mod download | ||
- run: cd integration ; npm install | ||
- run: .circleci/check-integration | ||
|
||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- lint | ||
- test | ||
- cover | ||
- integration | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.