fix: fix api log for docker compose #4
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
| name: "Agripredict API Test" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| api-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup DVC | |
| uses: iterative/setup-dvc@v1 | |
| with: | |
| version: '3.59.2' | |
| # - name: Setup CML | |
| # uses: iterative/setup-cml@v1 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run DVC pipeline | |
| run: | | |
| dvc repro | |
| - name: Run API tests | |
| run: | | |
| uvicorn main:app & | |
| API_PID=$! | |
| sleep 30 | |
| kill $API_PID | |
| wait $API_PID || true |