Skip to content

Commit

Permalink
Rename analyze github action to sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
groldan committed Dec 6, 2023
1 parent 9d22d88 commit 8e97381
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Builds and pushes docker images on main and tags

name: Analyze
name: SonarCloud QA
on:
push:
branches:
- main
paths:
- ".github/workflows/sonarcloud.yaml"
- "pom.xml"
- "src/**"
pull_request:
types: [opened, synchronize, reopened]

Expand All @@ -13,13 +17,18 @@ jobs:
name: Build and Analyze
runs-on: ubuntu-latest
timeout-minutes: 60
# Only analyze with Sonar on non-fork repos:
# https://github.community/t/how-to-detect-a-pull-request-from-a-fork/18363/4
# if: github.event.pull_request.head.repo.fork != true
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: recursive
show-progress: 'false'
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -33,13 +42,17 @@ jobs:

- name: Build customized GeoServer version
run: |
make deps
make deps
- name: Analyze
- name: Analyze with Sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn package org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=geoserver_geoserver-cloud -ntp -DskipTests
#mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=geoserver_geoserver-cloud
./mvnw package org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-Dsonar.projectKey=geoserver_geoserver-cloud \
-Dsonar.organization=geoserver \
-DskipTests \
-Dmaven.javadoc.skip=true \
-ntp
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ deps:
install:
./mvnw clean install -DskipTests -ntp -T4 -U

package:
./mvnw clean package -DskipTests -ntp -T4 -U

test:
./mvnw verify -ntp -T4

Expand Down

0 comments on commit 8e97381

Please sign in to comment.