Expand reservation workflow coverage and harden invalid-date handling #389
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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| test-and-analyze: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.13 # Upgrade when pysonar conflict for 'type' error resolved | |
| - name: Install dependencies | |
| run: cd backend && pip install -r requirements.txt pytest pytest-cov pytest-django pysonar | |
| - name: Run tests with coverage | |
| run: cd backend && pytest --cov=. --cov-report=xml | |
| - name: Run SonarCloud analysis | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| pysonar \ | |
| --sonar-project-key=conorheffron_booking-sys \ | |
| --sonar-organization=conorheffron \ | |
| --sonar-token=$SONAR_TOKEN |