Spaces:
Sleeping
Sleeping
| name: NetraID CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| - name: Install System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgl1 libglib2.0-0 espeak | |
| - name: Install Python Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r backend/requirements.txt | |
| - name: Run Pytest Test Suite | |
| run: | | |
| cd backend | |
| python -m pytest --cov=app --cov-report=xml -v | |
| build-containers: | |
| runs-on: ubuntu-latest | |
| needs: test-backend | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build Backend Image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./backend | |
| file: ./backend/Dockerfile | |
| push: false | |
| tags: netraid-backend:latest | |
| - name: Build Frontend Image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./frontend | |
| file: ./frontend/Dockerfile | |
| push: false | |
| tags: netraid-frontend:latest | |