Skip to content

Add additional checks for CI #13

Add additional checks for CI

Add additional checks for CI #13

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
ci:
name: CI
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.20', '1.21', '1.22']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go
- name: Run tests
run: |
go test -cover -v ./...
- name: Validate GraphQL queries
run: |
export EXITCODE=$(grep -E '^(mutation|query) [a-z]' queries/queries.graphql || echo $?)
if [[ $EXITCODE -eq 0 ]]; then
echo "Failed to validate queries."
echo "Ensure that queries are in title-case."
exit 1
fi
- name: Verify generated queries are up-to-date
run: |
go run main.go \
--input=queries/queries.graphql \
--output=queries/queries.go \
--package=queries
git diff --exit-code
exit $?