|
17 | 17 |
|
18 | 18 |
|
19 | 19 | jobs: |
20 | | - # sonarcloud: |
21 | | - # runs-on: ubuntu-latest |
22 | | - # env: |
23 | | - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
24 | | - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
25 | | - # permissions: |
26 | | - # contents: read |
27 | | - # steps: |
28 | | - # - name: Checkout code |
29 | | - # uses: actions/checkout@v2 |
30 | | - |
31 | | - # - name: SonarCloud Scan |
32 | | - # uses: sonarsource/sonarcloud-github-action@master |
33 | | - # with: |
34 | | - # args: sonar-scanner -Dsonar.projectKey=your_project_key -Dsonar.organization=your_organization_name -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} |
35 | | - # env: |
36 | | - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
37 | | - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 20 | + sonarqube: |
| 21 | + name: SonarQube |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis |
| 27 | + |
| 28 | + - name: Set up Node.js |
| 29 | + uses: actions/setup-node@v4 |
| 30 | + with: |
| 31 | + node-version: '18' |
| 32 | + cache: 'npm' |
| 33 | + cache-dependency-path: react/package-lock.json |
| 34 | + |
| 35 | + - name: Run npm install |
| 36 | + run: | |
| 37 | + cd react |
| 38 | + npm ci |
| 39 | +
|
| 40 | + - name: SonarQube Scan |
| 41 | + uses: SonarSource/sonarqube-scan-action@v5 |
| 42 | + env: |
| 43 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
38 | 44 |
|
39 | 45 | selenium: |
40 | 46 | runs-on: ubuntu-latest |
| 47 | + needs: sonarqube |
41 | 48 |
|
42 | 49 | env: |
43 | | - APP_URL: ${{ secrets.APP_URL || 'http://localhost:3000' }} |
| 50 | + APP_URL: 'http://localhost:3000' |
44 | 51 | DISPLAY: :99 |
45 | 52 |
|
46 | 53 | steps: |
@@ -106,7 +113,7 @@ jobs: |
106 | 113 | # Add HTML report generation |
107 | 114 | python -m pytest -v test_home_page.py --html=report.html |
108 | 115 | env: |
109 | | - APP_URL: ${{ secrets.APP_URL || 'http://localhost:3000' }} |
| 116 | + APP_URL: 'http://localhost:3000' |
110 | 117 | PYTHONPATH: ${{ github.workspace }} |
111 | 118 |
|
112 | 119 | - name: Upload test results |
|
0 commit comments