Skip to content

Commit

Permalink
Updating for new SonarCloud project
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen Carlsen committed Feb 24, 2024
1 parent dd64eb3 commit 3336f76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Build
name: SonarCloud
on:
push:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build:
name: Build
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand All @@ -34,4 +34,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ocarlsen_mock-slf4j-impl
11 changes: 6 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>

<!-- For Site Project Summary, "Java Version" field. -->
<maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.release}</maven.compiler.target>

<slf4j.version>2.0.0</slf4j.version>

<!-- SonarCloud project -->
<sonar.projectKey>ocarlsen_mock-slf4j-impl</sonar.projectKey>
<!-- <sonar.projectKey>ocarlsen_mock-slf4j-impl</sonar.projectKey>-->
<sonar.organization>ocarlsen</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<!-- For Site Project Summary, "Java Version" field. -->
<maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
</properties>

<dependencies>
Expand Down Expand Up @@ -226,6 +226,7 @@

<!-- The location where the site is uploaded -->
<path>${site.path}</path>

<!-- Use merge or override the content -->
<merge>true</merge>
</configuration>
Expand Down

0 comments on commit 3336f76

Please sign in to comment.