Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonarproject #1207

Merged
merged 13 commits into from
Nov 27, 2024
28 changes: 23 additions & 5 deletions .github/workflows/staging-deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,28 @@ jobs:
--form "projectVersion=latest" \
--form "[email protected]"

clean-up:
needs: [generate-and-push-sbom]
sonarqube:
runs-on: ubuntu-latest

needs: [upload-to-quay]
steps:
- name: remove dockers
run: docker ps -aq | xargs -r docker rm -f
- uses: actions/checkout@v4

- name: Set up JDK ${{ vars.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ vars.JAVA_VERSION }}
distribution: 'temurin'

- name: Set up node ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}

- name: Install frontend dependencies
run: cd frontend && npm ci

- name: Generate frontend test coverage
run: cd frontend && npm run test -- --coverage

- name: Build and analyze
run: mvn clean verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dsonar.host.url=${{vars.SONAR_HOST_URL}}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ hs_err_pid*
/.idea/
parent.iml
backend/backend.iml
sonar-project.properties
.scannerwork
/frontend/cypress/downloads/
/frontend/cypress/screenshots/
/toolchains.xml
/backend/src/main/resources/db/okr_schema.sql
**/sonar/
27 changes: 27 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,35 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>clean</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>sonar-project.properties</file>
</files>
</configuration>
<inherited>false</inherited>
</execution>
</executions>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>5.0.0.4389</version>
</plugin>
<plugin>
<groupId>com.fizzed</groupId>
<artifactId>fizzed-watcher-maven-plugin</artifactId>
Expand Down
14 changes: 14 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sonar.projectKey=Puzzle-OKR
sonar.projectName=Puzzle-OKR

#For local usage only, on the pipeline the following server is used: https://sonar-githubactions.puzzle.ch
sonar.host.url=https://sonar.puzzle.ch


sonar.test.exclusions=backend/src/test/**/*, frontend/src/app/**/*.spec.ts, frontend/src/app/**/*.scss, frontend/src/app/**/*.html

sonar.sources=frontend/src/app

sonar.coverage.exclusions=**/OkrApplication.java
sonar.coverage.jacoco.xmlReportPaths=target/site/jacoco-merged-test-coverage-report/jacoco.xml
sonar.javascript.lcov.reportPaths=frontend/coverage/lcov.info
Loading