Create load-tests/locustfile.py #66
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: RideSharing CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_DB: rides | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| redis: | |
| image: redis:7 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Run Tests | |
| run: pytest --cov=services tests/ | |
| - name: Build Docker Images | |
| run: docker-compose build |