From f624b6343fe9c3373c91cf677773390bf69c8a34 Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 4 Sep 2023 13:08:27 +0300 Subject: [PATCH] configuring pipelines for pull requests --- .github/workflows/code-quality.yml | 44 ++++++++++++++++++++++++++++++ .github/workflows/maven-build.yml | 31 +-------------------- 2 files changed, 45 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/code-quality.yml diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 000000000..6384a42fd --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,44 @@ +# 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: Code Quality for Pull Requests + +on: + pull_request: + branches: + - main + +jobs: + verify: + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '17' ] + steps: + - uses: actions/checkout@v3 + - name: Set up JDK ${{matrix.java}} + uses: actions/setup-java@v3 + with: + java-version: ${{matrix.java}} + distribution: 'adopt' + cache: maven + - name: Build with Maven Wrapper + run: ./mvnw -B verify + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + needs: verify + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + pr-mode: true + fetch-depth: 0 + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2023.2 +# env: +# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 8d9cad648..51f47d94e 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -6,8 +6,6 @@ name: Java CI with Maven on: push: branches: [ main ] - pull_request: - branches: [ main ] jobs: verify: @@ -24,31 +22,4 @@ jobs: distribution: 'adopt' cache: maven - name: Build with Maven Wrapper - run: ./mvnw -B verify - qodana: - runs-on: ubuntu-latest - needs: verify - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.2 -# env: -# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} - build: - runs-on: ubuntu-latest - needs: qodana - strategy: - matrix: - java: [ '17' ] - steps: - - uses: actions/checkout@v3 - - name: Set up JDK ${{matrix.java}} - uses: actions/setup-java@v2 - with: - java-version: ${{matrix.java}} - distribution: 'adopt' - cache: maven - - name: Build with Maven Wrapper - run: ./mvnw -B verify + run: ./mvnw -B package