troubleshoot github actions 2 #1
Workflow file for this run
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: Python application test | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
mongodb: | |
image: mongo | |
ports: | |
- 27017:27017 | |
options: "--health-cmd 'mongo --eval ''db.runCommand({ ping: 1 })'' --quiet' --health-interval 10s --health-timeout 5s --health-retries 5" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest flask flask_testing pymongo requests mock pytest-mock | |
- name: Run Tests | |
env: | |
MONGO_URI: mongodb://localhost:27017/test_db | |
FLASK_SECRET_KEY: your_secret_key_here | |
run: | | |
cd backend | |
pytest |