From be62933a7e1aae64c180567af1d1fb44438bc68a Mon Sep 17 00:00:00 2001 From: Antoine Rey Date: Wed, 10 Jul 2024 08:59:39 +0200 Subject: [PATCH] Disable Sonar analyze for Pull Request --- .../{maven-build.yml => maven-build-main.yml} | 2 +- .../workflows/maven-build-pull-request.yml | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) rename .github/workflows/{maven-build.yml => maven-build-main.yml} (97%) create mode 100644 .github/workflows/maven-build-pull-request.yml diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build-main.yml similarity index 97% rename from .github/workflows/maven-build.yml rename to .github/workflows/maven-build-main.yml index 78f996b2a..75a48e54f 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build-main.yml @@ -1,7 +1,7 @@ # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -name: Java CI with Maven +name: Java CI on main branch on: push: diff --git a/.github/workflows/maven-build-pull-request.yml b/.github/workflows/maven-build-pull-request.yml new file mode 100644 index 000000000..dbafa179e --- /dev/null +++ b/.github/workflows/maven-build-pull-request.yml @@ -0,0 +1,26 @@ +name: Java CI for Pull Request + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '17', '21' ] + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK ${{matrix.java}} + uses: actions/setup-java@v4 + with: + java-version: ${{matrix.java}} + distribution: 'adopt' + cache: maven + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./mvnw -B verify