fixed sonar properties #15
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: E2E + SonarQube | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| run-python-app: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| env: | |
| GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} | |
| DB_URL: ${{ secrets.DB_URL }} | |
| REDIS_HOST: localhost | |
| REDIS_PORT: 6379 | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| QDRANT_URL: http://localhost:6333 | |
| JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Set up Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| # Set up Docker Compose (run on root) | |
| - name: Set up Docker Compose | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y docker-compose | |
| # Start containers | |
| - name: Run docker-compose | |
| run: docker-compose -f docker-compose.yml up -d | |
| # Wait for services | |
| - name: Wait for services | |
| run: sleep 5 | |
| # install backend dependencies | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| working-directory: backend | |
| # Create Tables | |
| - name: Create DB Tables | |
| run: python tables.py | |
| working-directory: backend/setup_tables | |
| # Run All Services | |
| - name: Run all services | |
| run: | | |
| python backend/ai_analyze_service/app.py & | |
| python backend/auth_service/app.py & | |
| python backend/notes_crud_service/app.py & | |
| # Wait for services | |
| - name: Wait for services | |
| run: sleep 20 | |
| # Set up Node | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| # Install frontend dependencies | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: frontend | |
| # Build app (with coverage instrumentation) | |
| - name: Build React app with coverage | |
| run: npm run build | |
| working-directory: frontend | |
| # Start the app in background | |
| - name: Start React app | |
| run: npm run dev & | |
| working-directory: frontend | |
| - name: Wait for server | |
| run: npx wait-on http://localhost:5173 | |
| working-directory: frontend | |
| # install playwright browsers | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| working-directory: frontend | |
| # Run Playwright tests | |
| - name: Run Playwright tests | |
| run: npm run test:e2e-coverage | |
| working-directory: frontend | |
| continue-on-error: true | |
| # Upload coverage as artifacts | |
| - name: Upload coverage artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: frontend/coverage/ | |
| # Upload test reports as artifacts | |
| - name: Upload test report artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports | |
| path: frontend/playwright-report/ | |
| # SonarQube Analysis | |
| - name: SonarQube Scan | |
| uses: SonarSource/sonarqube-scan-action@v5 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |