From 6ef06163db3234636145602c973368e7f5c7b269 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Wed, 1 Sep 2021 10:01:08 +0200 Subject: [PATCH] schema: add a script to re-export the schema --- .github/workflows/rust.yml | 2 +- export_schema.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 export_schema.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1327f40..a4a3ec5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,7 +24,7 @@ jobs: - name: Generate GraphQL schema run: cargo run -- export_graphql_schema -o generated_schema.graphql - name: Check schema - run: diff schema.graphql generated_schema.graphql + run: diff schema.graphql generated_schema.graphql || (echo "The schema file is out of date. Please run `./export_schema.sh`" && false) clippy: diff --git a/export_schema.sh b/export_schema.sh new file mode 100755 index 0000000..31b3a0e --- /dev/null +++ b/export_schema.sh @@ -0,0 +1,5 @@ +#! /bin/sh + +cd $(dirname $(readlink -f "$0")) + +cargo run -- export_graphql_schema -o schema.graphql