Skip to content

Commit

Permalink
Feat SonarQube static code analysis workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonary committed Mar 19, 2024
1 parent e5b3adf commit 156dd23
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,27 @@ jobs:
working-directory: ./frontend


sonarcube-analysis:
name: Static Code Analysis
runs-on: ubuntu-latest
needs: [frontend-job, backend-job]
permissions: read-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}


deploy-job:
name: Deploy to Server
needs: [ backend-job, frontend-job]
Expand All @@ -97,7 +118,7 @@ jobs:
ssh-keyscan -p $SSH_PORT $SSH_HOST >> ~/.ssh/known_hosts
ssh -p $PORT $SSH_USERNAME@$SSH_HOST '~/deploy_script.sh'
lighthouse-job:
name: Lighthouse Audit
runs-on: ubuntu-latest
Expand Down

0 comments on commit 156dd23

Please sign in to comment.