Project 3 Info #73
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: Tests | |
on: | |
push: | |
branches: [project3] | |
pull_request: | |
branches: [project3] | |
jobs: | |
unittest: | |
runs-on: ubuntu-latest | |
env: | |
MONGO_URI: ${{ secrets.MONGO_URI }} | |
APP_PASSWORD: ${{ secrets.APP_PASSWORD }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 # Replace '3.x' with your desired Python version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
pip install -r ./backend/requirements.txt | |
sudo apt-get update | |
sudo apt-get install -y texlive-xetex texlive-fonts-extra | |
- name: Create env file | |
run: | | |
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" > .env | |
echo "MONGO_URI=${{ secrets.MONGO_URI }}" >> .env | |
- name: Test with pytest | |
run: | | |
pytest -v | |
python -c "import os;from pymongo import MongoClient; client = MongoClient(os.getenv('MONGO_URI')); client.testDB.movies.drop(); client.close()" |