-
-
Notifications
You must be signed in to change notification settings - Fork 885
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
Added server health check to github workflow #1717
Changes from 3 commits
61d4122
46771db
ce08301
980d320
6257c5c
a757f66
4c823fe
8684626
75823cc
f340592
be4c6b5
cf2698f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,95 @@ jobs: | |
path: './coverage/lcov.info' | ||
min_coverage: 95.0 | ||
|
||
Health-Check: | ||
name: Server health check | ||
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: | ||
MONGO_DB_URL: "mongodb://localhost:27017/talawa" | ||
RECAPTCHA_SITE_KEY: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | ||
RECAPTCHA_SECRET_KEY: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the app start when using these "XXXXXXXXXXXXXXXXXXXXXXXXXX" RECAPTCHA values? |
||
MAIL_USERNAME: "abc@gmail.com" | ||
MAIL_PASSWORD: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the app start when using this "XXXXXXXXXXXXXXXXXXXXXXXXXX" value? |
||
IS_SMTP: "" | ||
SMTP_HOST: "" | ||
SMTP_PASSWORD: "" | ||
SMTP_USERNAME: "" | ||
SMTP_PORT: "" | ||
SMTP_SSL_TLS: "" | ||
apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | ||
appId: "1:XXXXXXXXXXXX:android:XXXXXXXXXXXXXXXXXXXXXX" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Many of these environment variables are no longer used |
||
messagingSenderId: "XXXXXXXXXXXX" | ||
projectId: "appname-XXXXXX" | ||
storageBucket: "appname-XXXXXX.appspot.com" | ||
iOSapiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | ||
iOSappId: "1:XXXXXXXXXXXX:ios:XXXXXXXXXXXXXXXXXXXXXX" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are no tokens defined:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you tried starting the server with these |
||
iOSmessagingSenderId: "XXXXXXXXXXXX" | ||
iOSprojectId: "appame-XXXXXX" | ||
iOSstorageBucket: "appame-XXXXXX.appspot.com" | ||
iosClientId: "XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com" | ||
iosBundleId: "com.appname.app" | ||
LAST_RESORT_SUPERADMIN_EMAIL: "abc@gmail.com" | ||
COLORIZE_LOGS: "true" | ||
LOG_LEVEL: "info" | ||
|
||
steps: | ||
- name: Checkout | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, do we need to checkout again and reinstall the dependencies. |
||
run: npm ci | ||
|
||
- name: Start the development server | ||
run: | | ||
npm run dev & | ||
echo "Development server started..." | ||
# Sleep for 10 s | ||
- name: Sleep for 10s | ||
uses: juliangruber/sleep-action@v1 | ||
with: | ||
time: 10s | ||
|
||
#check http server status | ||
- name: Check server status | ||
shankeleven marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
if curl -f 'http://localhost:4000' | jq -e '. == {"talawa-version":"v1","status":"healthy"}' > /dev/null; then | ||
echo "Server is up and healthy" | ||
else | ||
echo "Server is down" | ||
exit 1 | ||
fi | ||
- name: Check Apollo Server status | ||
run: | | ||
if curl -f 'http://localhost:4000/graphql?query=%7B__typename%7D' \ | ||
SiddheshKukade marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-H 'Apollo-Require-Preflight: true' | jq -e '. == {"data":{"__typename":"Query"}}' > /dev/null; then | ||
echo "Apollo Server is up" | ||
else | ||
echo "Server is down" | ||
exit 1 | ||
fi | ||
JSDocs: | ||
name: 'JSDocs comments and pipeline' | ||
runs-on: ubuntu-latest | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to start mongo again if it was started already when testing the application?
I'm not sure whether the jobs are independent. The less steps we have the faster the testing so we need to verify.