Skip to content

Commit

Permalink
Update x/tools and add go v1.21,v1.22 in CI workflows (#2894)
Browse files Browse the repository at this point in the history
* Update golang.org/x/tools

* Update Go versions to 1.21 and 1.22 in CI workflows

* Run go mod tidy on submodule _examples

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Update to Go 1.20

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* go modules on for all checks

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* reduce redundant invocations

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* add echo to non-sensitive checks

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* More comments

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Make submodule go generate chain differently

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Add which cd

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Try to figure out why cd is not in path

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* set CWD to examples in go generate instead

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Try export

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Use env in go generate comment

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* make go generate comment always successful

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Try shelling out

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Update our github actions, npm, and go modules via dependabot

Signed-off-by: Steve Coffman <steve@khanacademy.org>

---------

Signed-off-by: Steve Coffman <steve@khanacademy.org>
Co-authored-by: Steve Coffman <steve@khanacademy.org>
  • Loading branch information
ryicoh and StevenACoffman authored Feb 7, 2024
1 parent e174d59 commit 143edeb
Show file tree
Hide file tree
Showing 20 changed files with 167 additions and 84 deletions.
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# Maintain dependencies for Go Modules
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/_examples" # Location of package manifests
schedule:
interval: "weekly"
# Maintain dependencies for npm
- package-ecosystem: "npm" # See documentation for possible values
directory: "integration" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "npm" # See documentation for possible values
directory: "_examples/chat" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "npm" # See documentation for possible values
directory: "_examples/federation" # Location of package manifests
schedule:
interval: "weekly"

2 changes: 1 addition & 1 deletion .github/workflows/check-coverage
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail
GO111MODULE=off go get github.com/mattn/goveralls
go install github.com/mattn/goveralls@latest

go test -covermode atomic -coverprofile=/tmp/coverage.out.tmp -coverpkg=./... $(go list github.com/99designs/gqlgen/... | grep -v _examples)
# ignore protobuf files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-federation
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail

export GO111MODULE=on
cd _examples/federation

./start.sh &
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-fmt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail

set -exuo pipefail
export GO111MODULE=on
go fmt ./...
cd _examples && go fmt ./...
if [[ $(git --no-pager diff) ]] ; then
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/check-generate
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

set -euo pipefail

set -exuo pipefail
export GO111MODULE=on
echo Generating in root
go generate ./...
echo Swithcing to _examples and generating again
cd _examples && go generate ./...
if [[ $(git --no-pager diff) ]] ; then
echo "you need to run "go generate ./..." and commit the changes"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-init
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail

export GO111MODULE=on
gqlgen_dir=$(pwd)
cd $(mktemp -d)
go mod init inittest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-integration
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail

export GO111MODULE=on
cd integration

date
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Coverage
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize ]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
coverage:
strategy:
matrix:
go: ["1.21", "1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: go mod download
- run: .github/workflows/check-coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/fmt-and-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Format and Generate
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize ]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
fmt-and-lint:
strategy:
matrix:
go: ["1.21", "1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: go mod download
- run: .github/workflows/check-fmt
- run: .github/workflows/check-generate
17 changes: 11 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Integration
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize ]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
Expand All @@ -9,8 +14,8 @@ jobs:
integration:
strategy:
matrix:
go: ["1.18", "1.20"]
node: [18]
go: ["1.21", "1.22"]
node: [20]
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
Expand All @@ -28,8 +33,8 @@ jobs:
federation:
strategy:
matrix:
go: ["1.18", "1.20"]
node: [14]
go: ["1.21", "1.22"]
node: [20]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -46,7 +51,7 @@ jobs:
init:
strategy:
matrix:
go: ["1.18", "1.20"]
go: ["1.21", "1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
38 changes: 7 additions & 31 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,20 @@
name: Lint
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize ]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
strategy:
matrix:
go: ["1.19", "1.20"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: go mod download
- run: .github/workflows/check-fmt
- run: .github/workflows/check-generate

coverage:
strategy:
matrix:
go: ["1.19", "1.20"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: go mod download
- run: .github/workflows/check-coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

golangci-lint:
strategy:
matrix:
go: ["1.19", "1.20"]
go: ["1.21", "1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Security
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize ]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
Expand All @@ -9,7 +14,7 @@ jobs:
nancy:
strategy:
matrix:
go: ["1.20"] # nancy is a little flaky
go: ["1.21"] # nancy is a little flaky
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Test
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize ]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
Expand All @@ -10,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
go: ["1.18", "1.20"]
go: ["1.21", "1.22"]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
Expand Down
10 changes: 5 additions & 5 deletions _examples/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/99designs/gqlgen/_examples

go 1.18
go 1.20

replace github.com/99designs/gqlgen => ../

Expand All @@ -24,13 +24,13 @@ require (
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sosodev/duration v1.1.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/tools v0.9.3 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/tools v0.17.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/pkg/errors v0.9.1 // indirect
golang.org/x/text v0.13.0
golang.org/x/text v0.14.0
)
20 changes: 10 additions & 10 deletions _examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ github.com/vektah/dataloaden v0.3.0/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf
github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8=
github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
2 changes: 1 addition & 1 deletion _examples/websocket-initfunc/server/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gqlgen/_examples/websocket-initfunc/server

go 1.18
go 1.20

require (
github.com/99designs/gqlgen v0.17.34
Expand Down
3 changes: 3 additions & 0 deletions generate_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
cd ./_examples
go generate ./... || return 0
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/99designs/gqlgen

go 1.18
go 1.20

require (
github.com/PuerkitoBio/goquery v1.8.1
Expand All @@ -17,8 +17,8 @@ require (
github.com/stretchr/testify v1.8.2
github.com/urfave/cli/v2 v2.25.5
github.com/vektah/gqlparser/v2 v2.5.11
golang.org/x/text v0.13.0
golang.org/x/tools v0.9.3
golang.org/x/text v0.14.0
golang.org/x/tools v0.17.0
google.golang.org/protobuf v1.30.0
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -31,7 +31,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
)
Loading

0 comments on commit 143edeb

Please sign in to comment.