diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml new file mode 100644 index 000000000..493cdf944 --- /dev/null +++ b/.github/workflows/analyze.yml @@ -0,0 +1,43 @@ +# Builds and pushes docker images on main and tags + +name: Analyze +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + name: Build and Analyze + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Setup Java + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '17' + cache: 'maven' + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Build customized GeoServer version + run: | + make deps + + - name: Analyze + 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 -Dsonar.projectKey=geoserver_geoserver-cloud + \ No newline at end of file diff --git a/pom.xml b/pom.xml index ee538ab14..d9c743a99 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,8 @@ format false UTF-8 + geoserver + https://sonarcloud.io