Skip to content

Ishtails

Ishtails #1641

Workflow file for this run

##############################################################################
##############################################################################
#
# NOTE!
#
# Please read the README.md file in this directory that defines what should
# be placed in this file
#
##############################################################################
##############################################################################
name: PR Workflow
on:
pull_request:
branches:
- '**'
env:
CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}
jobs:
Code-Quality-Checks:
name: Check for linting, formatting and type errors
runs-on: ubuntu-latest
steps:
- name: Checkout repository content
uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Run ESLint to check for linting errors
run: npm run lint:check
- name: Check for fomatting errors
run: npm run format:check
- name: Run Typescript Type-Checker
run: npm run typecheck
Test-Application:
name: Testing Application
runs-on: ubuntu-latest
needs: [Code-Quality-Checks]
strategy:
matrix:
node-version: [14.x]
services:
mongo:
image: mongo:4.4
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 27017:27017
env:
MONGO_DB_URL: mongodb://localhost:27017/talawa-test-db
# ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
# REFRESH_TOKEN_SECRET: ${{ secrets.REFRESH_TOKEN_SECRET }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate Access Token Secret
run: echo "ACCESS_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV
- name: Generate Refresh Token Secret
run: echo "REFRESH_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Install dependencies
run: npm ci
- name: Sleep for 10s
uses: juliangruber/sleep-action@v1
with:
time: 10s
- name: Run the tests
run: npm run test
- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v3
with:
verbose: true
fail_ci_if_error: false
name: '${{env.CODECOV_UNIQUE_NAME}}'
- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v2
with:
path: './coverage/lcov.info'
min_coverage: 95.0
JSDocs:
name: 'JSDocs comments and pipeline'
runs-on: ubuntu-latest
needs: Test-Application
steps:
- uses: actions/checkout@v3
- name: 'Check whether comments exists for JSDocs'
run: |
chmod +x ./.github/workflows/check-jsdocs-comment.py
./.github/workflows/check-jsdocs-comment.py
- name: 'Run JSDocs'
if: env.RUN_JSDOCS == 'True'
run: echo "Run JSdocs :${{ env.RUN_JSDOCS }}"
Dev-Server:
name: Dev-Server
runs-on: ubuntu-latest
needs: Test-Application
strategy:
matrix:
node-version: [14.x]
services:
mongo:
image: mongo:4.4
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 27017:27017
env:
ACCESS_TOKEN_SECRET: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
REFRESH_TOKEN_SECRET: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
MONGO_DB_URL: "mongodb://localhost:27017/talawa"
RECAPTCHA_SITE_KEY: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
RECAPTCHA_SECRET_KEY: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
MAIL_USERNAME: "[email protected]"
MAIL_PASSWORD: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
IS_SMTP: ""
SMTP_HOST: ""
SMTP_PASSWORD: ""
SMTP_USERNAME: ""
SMTP_PORT: ""
SMTP_SSL_TLS: ""
apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
appId: "1:XXXXXXXXXXXX:android:XXXXXXXXXXXXXXXXXXXXXX"
messagingSenderId: "XXXXXXXXXXXX"
projectId: "appname-XXXXXX"
storageBucket: "appname-XXXXXX.appspot.com"
iOSapiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
iOSappId: "1:XXXXXXXXXXXX:ios:XXXXXXXXXXXXXXXXXXXXXX"
iOSmessagingSenderId: "XXXXXXXXXXXX"
iOSprojectId: "appame-XXXXXX"
iOSstorageBucket: "appame-XXXXXX.appspot.com"
iosClientId: "XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com"
iosBundleId: "com.appname.app"
LAST_RESORT_SUPERADMIN_EMAIL: "[email protected]"
COLORIZE_LOGS: "true"
LOG_LEVEL: "info"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Install dependencies
run: npm ci
- name: Run dev server
run: npm run dev