Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NoMongo] : Restore the GraphQL Introspection GitHub Action Test (Fixes #3235) #3250

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 46 additions & 24 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##############################################################################

Check warning on line 1 in .github/workflows/pull-request.yml

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
##############################################################################
#
# NOTE!
Expand Down Expand Up @@ -288,33 +288,55 @@
path: "./coverage/lcov.info"
min_coverage: 0.0

# Graphql-Inspector:
# if: ${{ github.actor != 'dependabot[bot]' }}
# name: Runs Introspection on the GitHub talawa-api repo on the schema.graphql file
# runs-on: ubuntu-latest
# steps:
# - name: Checkout the Repository
# uses: actions/checkout@v4

# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '22.x'

# - name: resolve dependency
# run: npm install -g @graphql-inspector/cli
Graphql-Inspector:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Runs Introspection on the GitHub talawa-api repo on the schema.graphql file
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Install dependencies
run: npm install

# - name: Clone API Repository
# run: |
# # Retrieve the complete branch name directly from the GitHub context
# FULL_BRANCH_NAME=${{ github.base_ref }}
# echo "FULL_Branch_NAME: $FULL_BRANCH_NAME"
- name: Clone API Repository
run: |
# Retrieve the complete branch name directly from the GitHub context
FULL_BRANCH_NAME=${{ github.base_ref }}
echo "FULL_BRANCH_NAME: $FULL_BRANCH_NAME"

# Clone the specified repository using the extracted branch name
if ! git ls-remote --heads https://github.com/PalisadoesFoundation/talawa-api.git $FULL_BRANCH_NAME | grep -q .; then
echo "Error: Branch $FULL_BRANCH_NAME does not exist in talawa-api repository"
exit 1
fi

# # Clone the specified repository using the extracted branch name
# git clone --branch $FULL_BRANCH_NAME https://github.com/PalisadoesFoundation/talawa-api && ls -a
if ! git clone --branch $FULL_BRANCH_NAME --depth 1 https://github.com/PalisadoesFoundation/talawa-api; then
echo "Error: Failed to clone talawa-api repository"
exit 1
fi

- name: Install GraphQL Inspector
run: |
npm install -g @graphql-inspector/cli

# - name: Validate Documents
# run: graphql-inspector validate './src/GraphQl/**/*.ts' './talawa-api/schema.graphql'
- name: Validate Documents
run: |
if [ ! -f './talawa-api/schema.graphql' ]; then
echo "Error: schema.graphql not found in talawa-api"
exit 1
fi
GRAPHQL_FILES=$(find ./src/GraphQl -name "*.ts" -type f)
if [ -z "$GRAPHQL_FILES" ]; then
echo "Error: No GraphQL TypeScript files found"
exit 1
fi
graphql-inspector validate './src/GraphQl/**/*.ts' './talawa-api/schema.graphql'

Start-App-Without-Docker:
name: Check if Talawa Admin app starts (No Docker)
Expand Down
Loading
Loading