Updated gitignore and readded pre-commit #19
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
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.x' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run Flask app | |
run: | | |
nohup python manage.py > server.log 2>&1 & | |
echo $! > flask_server.pid | |
- 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 | |
- name: Stop Flask app | |
run: | | |
kill $(cat flask_server.pid) | |
continue-on-error: true |