SongodaCore/.github/workflows/sonarcloud.yml
Christian Koop 2a037e2853
Update required snakeyaml version from 1.26 to 1.30 (#41)
We probably want to take a look at what Spigot 1.8 comes with and if we are compatible or if we want to shade the lib into the Core instead.

Maybe we can have some kind of automatic legacy system that downloads an addional jar automatically when an unsupported Spigot version is detected... Lets see what time brings
2022-04-27 21:42:20 +02:00

51 lines
1.3 KiB
YAML

name: SonarCloud
on:
push:
branches: [ master, development ]
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
# Checkout project files
- uses: actions/checkout@v2
if: ${{ env.SONAR_TOKEN != null }}
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
# Setup Java
- uses: actions/setup-java@v2
if: ${{ env.SONAR_TOKEN != null }}
with:
java-version: 17
distribution: adopt
cache: maven
# Cache
- name: 'Cache: SonarCloud'
if: ${{ env.SONAR_TOKEN != null }}
uses: actions/cache@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
# Build Spigot 1.18.2 (remapped)
- uses: SpraxDev/Action-SpigotMC@v4
if: ${{ env.SONAR_TOKEN != null }}
with:
versions: 1.18.2
remapped: true
- name: Analyze project
if: ${{ env.SONAR_TOKEN != null }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=songoda_SongodaCore
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any