Skip to content

Commit

Permalink
action check diffs (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
mununki authored Oct 5, 2023
1 parent 7158d2a commit 44e7869
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/check-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check GraphQL Diff

on:
pull_request:

jobs:
check-diff:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
go-version:
- 1.20.6

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Go ${{ matrix.go-version}}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version}}

- name: Run make check-diff
run: |
make check-diff
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SHELL = /bin/bash

.PHONY: all build test
.PHONY: all build test check-diff

all: build test
all: build test check-diff

build:
go build
Expand All @@ -14,3 +14,11 @@ test: build
echo "Merging $$dir into $$output..."; \
./gqlmerge $$dir $$output; \
done

check-diff: build test
@if git diff --exit-code --quiet -- '*.graphql'; then \
echo "Ok"; \
else \
echo "Error: Differences found in generated.graphql files"; \
exit -1; \
fi

0 comments on commit 44e7869

Please sign in to comment.