red6/dmn-check

View on GitHub
.github/workflows/build.yml

Summary

Maintainability
Test Coverage
name: Java CI

on:
  push:
    branches:
      - master
      - 'release/*'
  pull_request:
    types: [ opened, synchronize, reopened ]

  pull_request_target:
    types: [ opened, synchronize, reopened ]

jobs:
  build-dmn-check:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0 # Disabling shallow clone is recommended for improving relevancy of reporting
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          java-version: '17'
          distribution: 'adopt'
          cache: maven
      - name: Build with Maven
        run: mvn clean install -P checkerframework


  sonarcloud:
    runs-on: ubuntu-latest
    # If the PR is coming from a fork (pull_request_target), ensure it's opened by "dependabot[bot]".
      # Otherwise, clone it normally.
    if: |
        (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
        (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
    steps:
      - name: Checkout
        if: ${{ github.event_name != 'pull_request_target' }}
        uses: actions/checkout@v4
      - name: Checkout PR
        if: ${{ github.event_name == 'pull_request_target' }}
        uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          java-version: '17'
          distribution: 'adopt'
      - env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: mvn -B verify jacoco:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=red6_dmn-check


  build-gradle-plugin:
    runs-on: ubuntu-latest
    needs: build-dmn-check
    steps:
      - uses: actions/checkout@v4
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          java-version: '17'
          distribution: 'adopt'
          cache: maven
      - name: Build with Gradle
        run: cd gradle-plugin && ./gradlew build