Skip to content

Commit

Permalink
Add workflow to generate client
Browse files Browse the repository at this point in the history
  • Loading branch information
rukmal committed Sep 27, 2022
1 parent f77c465 commit ccf958a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 64 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GraphQL API tests
name: Global data service push workflow

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

bal-test:
api-test:
name: GraphQL API Tests
runs-on: ubuntu-22.04
needs: push-db-container
Expand Down Expand Up @@ -85,3 +85,28 @@ jobs:
args: test
env:
WORKING_DIR: api
generate-graphql-client-job:
name: Generate GraphQL Client
needs: api-test
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
if: ${{ !env.ACT }} # Only run on GitHub Actions
uses: actions/checkout@v3
- name: Generate GraphQL Client
if: ${{ !env.ACT }}
uses: ballerina-platform/ballerina-action@394eb82cc07e020948fee8d1474143ae393147f4
with:
args: graphql -i graphql.config.yaml -o ../../client/
env:
WORKING_DIR: api/schema
- name: Display changes in generated client
run: |
git add . --force
git diff HEAD
- name: Commit sample artifacts to Pull Request
uses: EndBug/add-and-commit@v9 # See: https://github.com/marketplace/actions/add-commit
with:
add: "client --force"
default_author: github_actions
message: "[GitHub Actions] Commit generated GraphQL client"
2 changes: 1 addition & 1 deletion client/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "avinyafoundation"
name = "global_data_client"
version = "1.0.0"
version = "0.1.2"
distribution = "2201.1.1"

[build-options]
Expand Down
2 changes: 1 addition & 1 deletion client/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies-toml-version = "2"
[[package]]
org = "avinyafoundation"
name = "global_data_client"
version = "1.0.0"
version = "0.1.2"
dependencies = [
{org = "ballerina", name = "graphql"},
{org = "ballerina", name = "http"},
Expand Down
1 change: 1 addition & 0 deletions client/Package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Avinya Foundation Global Data Service
17 changes: 0 additions & 17 deletions client/geo_data_client.bal

This file was deleted.

20 changes: 0 additions & 20 deletions client/types.bal

This file was deleted.

23 changes: 0 additions & 23 deletions client/utils.bal

This file was deleted.

0 comments on commit ccf958a

Please sign in to comment.