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
|
2024-09-30 13:24:24 -05:00
|
|
|
runs-on: ubuntu-latest
|
2022-07-15 06:10:51 -05:00
|
|
|
steps:
|
2023-09-05 14:30:49 -05:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-12 05:44:28 -05:00
|
|
|
- uses: actions/setup-go@v5
|
2022-07-15 06:10:51 -05:00
|
|
|
with:
|
2023-03-22 14:33:21 -05:00
|
|
|
cache: false
|
2024-11-08 11:58:55 -05:00
|
|
|
go-version: 1.23.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:
|
2023-09-05 14:30:49 -05:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-02 15:46:35 -05:00
|
|
|
- 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
|