-
Notifications
You must be signed in to change notification settings - Fork 59
Added ci workflow #40
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
Open
KumarAyush204
wants to merge
15
commits into
Code-A2Z:master
Choose a base branch
from
KumarAyush204:ci-workflow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
da47351
Added ci workflow
KumarAyush204 77273e1
Update ci.yml
KumarAyush204 80c1083
Merge branch 'Code-A2Z:master' into ci-workflow
KumarAyush204 2554b63
Update ci.yml
KumarAyush204 06090fc
Update ci.yml
KumarAyush204 cedecd9
Update ci.yml
KumarAyush204 7329749
Update ci.yml
KumarAyush204 15cce26
Update ci.yml
KumarAyush204 53c26d8
Update ci.yml
KumarAyush204 d6266c3
Update ci.yml
KumarAyush204 5f783bb
Update ci.yml
KumarAyush204 7d0530e
Update ci.yml
KumarAyush204 77289ad
Update ci.yml
KumarAyush204 95e3753
Update ci.yml
KumarAyush204 271609f
Update auth.test.js
KumarAyush204 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Paisable CI | ||
on: [push,pull_request] | ||
jobs: | ||
CI: | ||
runs-on: ubuntu-latest | ||
# services: | ||
# mongo: | ||
# image: mongo:6 | ||
# ports: | ||
# - 27017:27017 | ||
# options: >- | ||
# --health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'" | ||
# --health-interval=10s | ||
# --health-timeout=5s | ||
# --health-retries=5 | ||
env: | ||
PORT: 5000 | ||
MONGO_URI: mongodb://mongo:27017/testdb | ||
JWT_SECRET: ${{ secrets.JWT_SECRET }} | ||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
VITE_API_URL: http://localhost:5000/api | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
path: . | ||
- name: Setup Node | ||
uses: actions/[email protected] | ||
- name: Install Backend & Run | ||
run: | | ||
cd backend | ||
npm install | ||
npm run test | ||
npm run dev > server.log 2>&1 & | ||
server_pid=$! | ||
echo "Server started with PID: $server_pid" | ||
|
||
for i in {1..15}; do | ||
if curl -fs http://localhost:5000 > /dev/null; then | ||
echo "Server is up!" | ||
kill $server_pid | ||
echo "No issues found!" | ||
exit 0 | ||
fi | ||
echo "Waiting for server... (attempt $i/15)" | ||
sleep 2 | ||
done | ||
|
||
echo "Server failed to start. Printing logs:" | ||
cat server.log | ||
kill $server_pid | ||
exit 1 | ||
- name: Install Frontend & Run | ||
run: | | ||
cd frontend | ||
npm install | ||
# npm run test | ||
npm run build | ||
|
||
|
||
|
||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Have you test in case of DB not connected?
I think you need to update the db not to be take exit in case of CI workflow. Right?
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.
There are some problems related to db test cases right now. I'm trying to figure it out. Once fixed i will mention you.