Skip to content

Merge pull request #323 from MaximeJo/issue-322 #13

Merge pull request #323 from MaximeJo/issue-322

Merge pull request #323 from MaximeJo/issue-322 #13

Workflow file for this run

name: Java CI with Maven
on: [ push ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Build with Maven
run: mvn -B -U -f pom.xml install checkstyle:checkstyle
- name: SonarQube scan
run: |
if [ $PROJECT_KEY != 'Hipparchus-Math/hipparchus' ] ; then export KEY_OPTION="-Dsonar.projectKey=${PROJECT_KEY/\//:}" ; fi
if [ $PROJECT_KEY != 'Hipparchus-Math/hipparchus' ] ; then export PROJECT_NAME="$PROJECT_NAME ($PROJECT_KEY)" ; fi
mvn -B -f pom.xml sonar:sonar \
-Dsonar.host.url=$SONARQUBE_HOST_URL \
-Dsonar.login=$SONARQUBE_TOKEN \
-Dsonar.branch.name=${GITHUB_REF##*/} \
-Dsonar.projectName="$PROJECT_NAME" \
\
$KEY_OPTION
env:
SONARQUBE_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
SONARQUBE_HOST_URL: ${{ vars.SONARQUBE_HOST_URL }}
PROJECT_KEY: ${{ github.repository }}
PROJECT_NAME: 'Hipparchus'
KEY_OPTION: ''
- name: Deployment
if: ( github.repository == 'Hipparchus-Math/hipparchus' ) && ( ( github.ref == 'refs/heads/master' ) || startsWith( github.ref, 'refs/heads/release-' ) )
run: mvn -B -U -f pom.xml -s .CI/maven-settings.xml deploy -Pci-deploy -DskipTests=true
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}