diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b2b1640740..859edd3460 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,42 +1,36 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Java CI - -on: [push, pull_request] - +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] jobs: build: - + name: Build runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental }} - strategy: - matrix: - java: [ 8, 11, 17 ] - experimental: [false] -# include: -# - java: 18-ea -# experimental: true - steps: - - uses: actions/checkout@v2.4.0 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v2 - with: - distribution: adopt - java-version: ${{ matrix.java }} - cache: 'maven' - - name: Build with Maven - run: mvn -V apache-rat:check spotbugs:check javadoc:javadoc -Ddoclint=all package --file pom.xml --no-transfer-progress + - uses: actions/checkout@v2 + 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 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify -DskipTests -Drat.skip=true org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=AlbiK47_commons-text diff --git a/.github/workflows/sonarbuild b/.github/workflows/sonarbuild new file mode 100644 index 0000000000..db0907284f --- /dev/null +++ b/.github/workflows/sonarbuild @@ -0,0 +1,36 @@ +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + 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 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and 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=AlbiK47_commons-text diff --git a/pom.xml b/pom.xml index 976d7b048c..c622d245ea 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,14 @@ UTF-8 1.8 1.8 + + + albik47 + https://sonarcloud.io + + + albik47 + https://sonarcloud.io text org.apache.commons.text @@ -75,6 +83,11 @@ Gary Gregory 86fdc7e2a11262cb + + + albik47 + https://sonarcloud.io +