Skip to content

Commit

Permalink
Merge pull request #214 from EmmanuelDemey/GtanSndil-patch-1
Browse files Browse the repository at this point in the history
feat: add quality
  • Loading branch information
ddecrulle authored Dec 12, 2024
2 parents d1d5d37 + 40b1f3c commit 7fd4970
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test and Sonar Analysis
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
jobs:
test-build:
name: build & test & analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Run unit tests
run: mvn -B clean test
- name: Run Sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -X -B clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<rdf4j.version>5.0.0-M3</rdf4j.version>
<springdoc.version>2.3.0</springdoc.version>
<jacoco.version>0.8.12</jacoco.version>

<sonar.organization>inseefr</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.projectKey>InseeFr_Magma</sonar.projectKey>
</properties>

<dependencies>
Expand Down

0 comments on commit 7fd4970

Please sign in to comment.