mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 08:15:48 +00:00
Switch to SonarCloud
This commit is contained in:
+25
-17
@@ -5,7 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -13,33 +13,41 @@ jobs:
|
|||||||
name: Build, Test & Scan
|
name: Build, Test & Scan
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '18'
|
java-version: '18'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: 'maven'
|
|
||||||
|
- name: Cache SonarCloud packages
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.sonar/cache
|
||||||
|
key: ${{ runner.os }}-sonar
|
||||||
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
|
|
||||||
|
- name: Cache Maven packages
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.m2
|
||||||
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: ${{ runner.os }}-m2
|
||||||
|
|
||||||
- name: Extract Maven project version
|
- name: Extract Maven project version
|
||||||
id: project
|
id: project
|
||||||
run: echo "GAMEYFIN_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
|
run: echo "GAMEYFIN_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Show extracted Maven project version
|
- name: Build and analyze
|
||||||
run: echo "${{ steps.project.outputs.GAMEYFIN_VERSION }}"
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||||
- name: Maven build
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
run: mvn --batch-mode --update-snapshots package
|
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
|
||||||
|
|
||||||
- name: SonarQube scan
|
|
||||||
uses: kitabisa/sonarqube-action@v1.2.0
|
|
||||||
with:
|
|
||||||
host: https://sonarqube.grimsi.de
|
|
||||||
login: ${{ secrets.SONARQUBE_TOKEN }}
|
|
||||||
projectKey: grimsi_gameyfin_AYPM67pzsxiaNzCh9BZd
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|||||||
@@ -26,9 +26,13 @@
|
|||||||
<connection>scm:git:https://github.com/grimsi/gameyfin.git</connection>
|
<connection>scm:git:https://github.com/grimsi/gameyfin.git</connection>
|
||||||
<url>scm:git:https://github.com/grimsi/gameyfin.git</url>
|
<url>scm:git:https://github.com/grimsi/gameyfin.git</url>
|
||||||
<developerConnection>scm:git:https://github.com/grimsi/gameyfin.git</developerConnection>
|
<developerConnection>scm:git:https://github.com/grimsi/gameyfin.git</developerConnection>
|
||||||
<tag>v1.2.2</tag>
|
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<sonar.organization>grimsi-github</sonar.organization>
|
||||||
|
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
sonar.projectKey=grimsi_gameyfin_AYPM67pzsxiaNzCh9BZd
|
sonar.projectKey=grimsi_gameyfin
|
||||||
|
|
||||||
# Point SONAR to the compiled Java classes
|
# Point SONAR to the compiled Java classes
|
||||||
sonar.java.binaries=./backend/target
|
sonar.java.binaries=./backend/target
|
||||||
|
|||||||
Reference in New Issue
Block a user