github.com/shippio/gqlgen@v0.0.0-20220912092219-633ea699ef07/.github/workflows/check-init (about)

     1  #!/bin/bash
     2  
     3  set -euo pipefail
     4  
     5  gqlgen_dir=$(pwd)
     6  cd $(mktemp -d)
     7  go mod init inittest
     8  printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go
     9  go mod tidy
    10  go mod edit -replace=github.com/99designs/gqlgen="$gqlgen_dir"
    11  go mod tidy
    12  
    13  if ! go run github.com/99designs/gqlgen init ; then
    14      echo "gqlgen init failed"
    15      exit 125
    16  fi
    17  
    18  if ! go run github.com/99designs/gqlgen generate ; then
    19      echo "gqlgen generate failed"
    20      exit 125
    21  fi