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