Skip to content

Commit

Permalink
Update python-app.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ka8540 authored Mar 26, 2024
1 parent 220ded5 commit 880f5f2
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ permissions:
jobs:
test:
runs-on: ubuntu-latest
services:
# Example for setting up PostgreSQL, adjust as needed
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
# Set up any other necessary services here
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -24,14 +34,25 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flask_cors
pip install -r requirements.txt # Install dependencies from your requirements.txt file
pip install -r requirements.txt
- name: Set FLASK_APP environment variable
run: echo "src/server.py" >> $GITHUB_ENV
# Replace your_application_entry_point with the path to your Flask app, e.g., src/server.py
working-directory: ${{ github.workspace }}/PCP/server


- name: Start Flask server
run: |
flask run --host=0.0.0.0 &
env:
# Ensure all necessary environment variables for your Flask app are set here
FLASK_ENV: development

- name: Delay for Flask server to start
run: sleep 5 # Adjust the sleep time as necessary

- name: Run unit tests
run: |
python -m unittest discover tests -v
working-directory: ${{ github.workspace }}/PCP/server #okay
working-directory: ${{ github.workspace }}/PCP/server # Adjust if necessary

0 comments on commit 880f5f2

Please sign in to comment.