Skip to content

Commit

Permalink
Merge branch '99designs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jesse-apollo committed Feb 21, 2024
2 parents c410e1b + e186813 commit 9ada2e2
Show file tree
Hide file tree
Showing 52 changed files with 10,016 additions and 3,088 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
5 changes: 3 additions & 2 deletions .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 All @@ -18,5 +18,6 @@ curl -s --connect-timeout 5 \
sleep 1

echo "### running jest integration spec"
./node_modules/.bin/jest --color
export NODE_OPTIONS="--experimental-vm-modules"
npx jest --color

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.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
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@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: go mod download
- run: .github/workflows/check-fmt
- run: .github/workflows/check-generate
31 changes: 18 additions & 13 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,16 +14,16 @@ jobs:
integration:
strategy:
matrix:
go: ["1.18", "1.20"]
go: ["1.21", "1.22"]
node: [18]
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: go mod download
Expand All @@ -28,15 +33,15 @@ jobs:
federation:
strategy:
matrix:
go: ["1.18", "1.20"]
node: [14]
go: ["1.21", "1.22"]
node: [18]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: go mod download
Expand All @@ -46,11 +51,11 @@ jobs:
init:
strategy:
matrix:
go: ["1.18", "1.20"]
go: ["1.21", "1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: .github/workflows/check-init
44 changes: 10 additions & 34 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,28 @@
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
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.5.0
uses: golangci/golangci-lint-action@v4.0.0
with:
version: latest
# skip cache because of flaky behaviors
Expand Down
13 changes: 9 additions & 4 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,11 +14,11 @@ 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
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: go mod download && go list -json -deps all > go.list
Expand Down
17 changes: 11 additions & 6 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,24 +15,24 @@ 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:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Core tests
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 20
command: |
go mod download
go test -race ./...
- name: Example tests
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 20
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
*.out
gqlgen
*.exe

node_modules
14 changes: 7 additions & 7 deletions _examples/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"dependencies": {
"@apollo/client": "^3.2.3",
"apollo-utilities": "^1.0.26",
"graphql": "^14.0.2",
"graphql": "^16.8.1",
"graphql-sse": "^2.0.0",
"graphql-tag": "^2.10.0",
"graphql-ws": "^5.8.1",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-scripts": "^2.1.1",
"styled-components": "^5.2.0",
"subscriptions-transport-ws": "^0.9.5",
"typescript": "^4.9.4"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1",
"styled-components": "^6.1.8",
"subscriptions-transport-ws": "^0.11.0",
"typescript": "^5.3.3"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion _examples/chat/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const apolloClient = new ApolloClient({

if (module.hot) {
module.hot.accept('./App', () => {
const NextApp = require('./App').default;
const NextApp = import('./App').default;
render(<NextApp/>);
})
}
Expand Down
Loading

0 comments on commit 9ada2e2

Please sign in to comment.