2023-02-02 15:46:35 -05:00
|
|
|
name: "GQL generation and linting"
|
2022-07-15 06:10:51 -05:00
|
|
|
|
|
|
|
# Validate gqlgen works
|
|
|
|
# Validate there are no uncommitted changes after running gqlgen
|
2023-02-17 16:54:49 -05:00
|
|
|
# Lint the graphql schema
|
2022-07-15 06:10:51 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches: [main]
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
|
|
|
|
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
gqlgen:
|
|
|
|
name: Check GQL generation
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
2022-10-05 05:21:14 -05:00
|
|
|
go-version: 1.19.x
|
2022-07-15 06:10:51 -05:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
go mod download
|
|
|
|
- name: Run gqlgen
|
|
|
|
run: |
|
|
|
|
make gqlgen
|
|
|
|
- name: Verify uncommitted files
|
|
|
|
run: |
|
|
|
|
make verify-gql-committed
|
2023-02-02 15:46:35 -05:00
|
|
|
gqllint:
|
2023-02-17 16:54:49 -05:00
|
|
|
name: Check GQL schema follows best practices
|
2023-02-02 15:46:35 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
npm install graphql-schema-linter graphql
|
2023-02-17 16:54:49 -05:00
|
|
|
- name: Lint the graphql schema
|
2023-02-02 15:46:35 -05:00
|
|
|
run: |
|
2023-02-17 16:54:49 -05:00
|
|
|
npm exec graphql-schema-linter pkg/extensions/search/*.graphql
|