-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added github workflows to make sure application is able to build itse…
…lf properly
- Loading branch information
1 parent
b49936c
commit 85b2a07
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,36 @@ | ||
name: Flask App Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install dependencies | ||
working-directory: e-invoice/e_invoice | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run Flask app | ||
working-directory: e-invoice/e_invoice | ||
run: | | ||
nohup flask run & # Start Flask application in the background | ||
- name: Test /login route | ||
run: | | ||
sleep 10 # Wait for the server to start | ||
curl -s --head http://127.0.0.1:5000/login | head -n 10 # Check if /login returns HTML | ||
- name: Stop Flask app | ||
run: | | ||
pkill -f 'flask run' # Stop the Flask app |