Skip to content

Commit

Permalink
fix: generate sdk for merge pull request
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
  • Loading branch information
Abirdcfly committed Jan 5, 2024
1 parent a6c5fc8 commit d61226d
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/example_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
testOnly:
description: 'generated sdk test only or not'
required: true
default: 'true'
type: choice
options:
- true
- false

env:
LOG_DIR: "/tmp/kubeagi-example-test/logs"
Expand Down Expand Up @@ -104,16 +113,22 @@ jobs:
gql:
- 'apiserver/graph/schema/*.gql'
- name: setting token to npmrc
if: github.event == 'push' && steps.gql-changes.outputs.gql == 'true' && matrix.no == 1
if: (( github.event.pull_request.merged == true && steps.gql-changes.outputs.gql == 'true') || github.event_name == 'workflow_dispatch') && matrix.no == 1
run: |
echo '//dev-npm.tenxcloud.net/:_authToken="${{ secrets.TENX_NPM_TOKEN }}"' >> ~/.npmrc
echo '//registry.npmjs.org/:_authToken="${{ secrets.NPM_TOKEN }}"' >> ~/.npmrc
- name: Set variable on Push
if: github.event == 'push' && matrix.no == 1
- name: Set variable on Merge pull request
if: github.event.pull_request.merged == true && matrix.no == 1
run: |
echo "GRL_SDK_TEST_ONLY=false" >> $GITHUB_ENV
- name: Set variable on workflow_dispatch
if: github.event_name == 'workflow_dispatch'
run: |
echo "GRL_SDK_TEST_ONLY=$TEST_ONLY" >> $GITHUB_ENV
env:
TEST_ONLY: ${{ inputs.testOnly }}
- name: make sdk
if: steps.gql-changes.outputs.gql == 'true' && matrix.no == 1
if: (steps.gql-changes.outputs.gql == 'true' || github.event_name == 'workflow_dispatch') && matrix.no == 1
run: |
kubectl port-forward svc/arcadia-apiserver -n arcadia 8888:8081 --address 0.0.0.0 >/dev/null 2>&1 &
export GRAPH_API_ENDPOINT="http://0.0.0.0:8888/bff"
Expand Down

0 comments on commit d61226d

Please sign in to comment.