Skip to content

Commit

Permalink
Attempt to enable SonarCloud (frankframework#5332)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsm5 authored Sep 5, 2023
1 parent 9556f5e commit bf96226
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
PROFILES: ibissource,codecoverage,cmis,attachFrankDoc
USE_PROPRIETARY: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == 'ibissource') && github.actor != 'dependabot[bot]' }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
MAVEN_GOALS: verify

on:
push:
Expand Down Expand Up @@ -61,6 +62,13 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
Expand All @@ -73,19 +81,26 @@ jobs:
with:
servers: '[{"id": "proprietary", "username": "${{ secrets.CI_USER }}", "password": "${{ secrets.CI_PASS }}"}]'

- name: Update maven profiles
- name: Update Maven profiles
if: ${{ env.USE_PROPRIETARY == 'true' }}
run: |
echo "PROFILES=${{ env.PROFILES }},proprietary" >> $GITHUB_ENV
- name: Update environment when JDK == 11
if: ${{ matrix.java == '11' }}
run: |
echo "MAVEN_GOALS=${{ env.MAVEN_GOALS }} org.sonarsource.scanner.maven:sonar-maven-plugin:sonar" >> $GITHUB_ENV
# Use Maven Wrapper so we can build with an older version of Maven, see PR #4579.
- name: Build with Maven
env:
CI_SERVICE: GITHUB
TZ: Europe/Amsterdam
JAVA_OPTS: "-Xms1G -XX:+UseParallelGC"
jdk11: true # allows the use of the JDK11 profile, when running JDK11
run: ./mvnw -B -V -T1 package -P${{env.PROFILES}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # SonarCloud
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # SonarCloud
run: ./mvnw -B -V -T1 ${{env.MAVEN_GOALS}} -P${{env.PROFILES}} -Dsonar.projectKey=ibissource_iaf

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<log4j2.version>2.20.0</log4j2.version>

<sonar.organization>frank-framework</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<jackson.version>2.15.2</jackson.version>
<cxf.version>3.5.6</cxf.version>
<spring.version>5.3.29</spring.version>
Expand Down

0 comments on commit bf96226

Please sign in to comment.