mirror of
https://github.com/project-zot/zot.git
synced 2025-01-20 22:52:51 -05:00
ci(workflows): changed ci-cd workflow to generate introspection json when gql schema changed (#810)
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com>
This commit is contained in:
parent
3c0c51fcbe
commit
9916449d88
2 changed files with 26 additions and 0 deletions
25
.github/workflows/ci-cd.yml
vendored
25
.github/workflows/ci-cd.yml
vendored
|
@ -106,6 +106,31 @@ jobs:
|
|||
overwrite: true
|
||||
file_glob: true
|
||||
|
||||
- name: Check if GraphQL Schema Changed
|
||||
if: matrix.os == 'linux' && matrix.arch == 'amd64'
|
||||
id: changed-files-specific
|
||||
uses: tj-actions/changed-files@v29
|
||||
with:
|
||||
files: |
|
||||
pkg/extensions/search/schema.graphql
|
||||
|
||||
- name: Generate GraphQL Introspection JSON
|
||||
if: steps.changed-files-specific.outputs.any_changed == 'true' && matrix.os == 'linux' && matrix.arch == 'amd64'
|
||||
run: |
|
||||
echo "Schema has changed"
|
||||
bin/zot-linux-amd64 serve examples/config-search.json &
|
||||
sleep 10
|
||||
mkdir introspection
|
||||
curl -X POST -H "Content-Type: application/json" -d @.pkg/debug/githubWorkflows/introspection-query.json http://localhost:5000/v2/_zot/ext/search | jq > introspection/introspection-result.json
|
||||
pkill zot
|
||||
|
||||
- name: Upload GraphQL Introspection JSON
|
||||
uses: actions/upload-artifact@v3
|
||||
if: steps.changed-files-specific.outputs.any_changed == 'true' && matrix.os == 'linux' && matrix.arch == 'amd64'
|
||||
with:
|
||||
name: introspection-result
|
||||
path: introspection/introspection-result.json
|
||||
|
||||
push-image:
|
||||
if: github.event_name == 'release' && github.event.action== 'published'
|
||||
name: Push OCI images to GitHub Packages
|
||||
|
|
1
pkg/debug/githubWorkflows/introspection-query.json
Normal file
1
pkg/debug/githubWorkflows/introspection-query.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"query": "{__schema{queryType{name}mutationType{name}subscriptionType{name}types{...FullType}directives{name description locations args{...InputValue}}}}fragment FullType on __Type{kind name description fields(includeDeprecated:true){name description args{...InputValue}type{...TypeRef}isDeprecated deprecationReason}inputFields{...InputValue}interfaces{...TypeRef}enumValues(includeDeprecated:true){name description isDeprecated deprecationReason}possibleTypes{...TypeRef}}fragment InputValue on __InputValue{name description type{...TypeRef}defaultValue}fragment TypeRef on __Type{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name}}}}}}}}"}
|
Loading…
Add table
Reference in a new issue