Merge pull request #108 from harshitsaini17/feature/search #24
This file contains hidden or 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
on: | |
push: | |
branches: [ main ] | |
branches: [ '*' ] # Runs on any branch | |
pull_request: | |
branches: [ main ] | |
branches: [ '*' ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up python | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.9' | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r server/requirements.txt | |
# - name: Run tests | |
# run: | | |
# python manage.py test | |
- name: Check for errors | |
if [ -f server/requirements.txt ]; then | |
python -m pip install --upgrade pip | |
pip install -r server/requirements.txt | |
else | |
echo "requirements.txt not found. Skipping dependency installation." | |
fi | |
- name: Run Django tests | |
run: | | |
if [ -f manage.py ]; then | |
python manage.py test | |
else | |
echo "manage.py not found. Skipping tests." | |
fi | |
- name: Run Django checks for errors | |
run: | | |
if [ -f manage.py ]; then | |
python manage.py check | |
else | |
echo "manage.py not found. Skipping Django checks." | |
fi | |
- name: Lint code | |
run: | | |
python manage.py check | |
pip install flake8 | |
flake8 . |