Testing server endpoints when api folder changes #26
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: Testing API | |
run-name: Testing server endpoints when api folder changes | |
on: | |
push: | |
paths: | |
- 'src/api/**' | |
- 'tests/api_testing/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
- name: Set up DVC | |
uses: iterative/setup-dvc@v1 | |
- name: Setup a Google Drive DVC Remote and pull data | |
env: | |
GDRIVE_CREDENTIALS_DATA: ${{ secrets.GDRIVE_CREDENTIALS_DATA }} | |
run: | | |
dvc remote modify myremote gdrive_use_service_account true | |
dvc pull -r myremote | |
- name: Extract data | |
run: | | |
sudo apt-get install -y unzip | |
unzip data/processed/datasets_processed.zip -d data/processed/datasets_processed | |
- name: Test with pytest | |
run: | | |
cd tests/api_testing | |
pytest |