From 505985ab477bc9650d4b65b3be401569f2fd2d1c Mon Sep 17 00:00:00 2001 From: Philzen Date: Wed, 12 Jun 2024 14:45:43 +0200 Subject: [PATCH] Move maven build action into Analyze workflow --- .github/workflows/analyse.yml | 25 +++++++++++++++++++++---- .github/workflows/ci.yml | 21 --------------------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index 88deb264..5a199243 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -1,9 +1,10 @@ name: SonarCloud on: - workflow_call: - inputs: {} + push: + branches: [main] pull_request: types: [opened, synchronize, reopened] + jobs: analyze: name: Analyze @@ -29,11 +30,27 @@ jobs: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Download code coverage results - uses: actions/download-artifact@v4 + + - name: "[Maven] Verify & generate JaCoCo XML" + env: + MAVEN_OPTS: '-Dstyle.color=always' + MAVEN_SWITCHES: >- + --show-version + --no-transfer-progress + --update-snapshots + --fail-at-end + --batch-mode + run: mvn ${{ env.MAVEN_SWITCHES }} -P coverage verify + + - name: Upload maven build result + uses: actions/upload-artifact@v4 with: name: maven-build-target-folder path: target + + - name: List current location + run: find . + - name: Analyze project env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58d1a9f9..bd294e60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,27 +36,6 @@ jobs: uses: gradle/actions/setup-gradle@v3 with: arguments: ${{ env.GRADLE_SWITCHES }} build test - - name: "[Maven] Verify & generate JaCoCo XML" - env: - MAVEN_OPTS: '-Dstyle.color=always' - MAVEN_SWITCHES: >- - --show-version - --no-transfer-progress - --update-snapshots - --fail-at-end - --batch-mode - run: mvn ${{ env.MAVEN_SWITCHES }} -P coverage verify - - - name: Upload maven build result - uses: actions/upload-artifact@v4 - with: - name: maven-build-target-folder - path: target - - call: - needs: [build] - uses: './.github/workflows/analyse.yml' - secrets: inherit publish-snapshots: needs: [build]