Update ci-cd.yaml #2
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: Run Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Test FastAPI Application | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Set Google API Key | |
env: | |
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} | |
MONGO_USERNAME: ${{ secrets.MONGO_USERNAME }} | |
MONGO_PASSWORD: ${{ secrets.MONGO_PASSWORD }} | |
MONGO_DBNAME: ${{ secrets.MONGO_DBNAME }} | |
MONGO_COLLECTION: ${{ secrets.MONGO_COLLECTION }} | |
run: | | |
echo "Google API Key: Succesfull!!!" | |
- name: Run Tests | |
run: | | |
pytest test_main.py |