From 0b113c688053a82543b44d9a8e558c3eeea130cd Mon Sep 17 00:00:00 2001 From: "neha.puraswani" Date: Thu, 26 Oct 2023 15:55:17 +0530 Subject: [PATCH 1/2] feat(app-test.yaml): Update github workflow --- .github/workflows/app-test.yml | 95 +++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/.github/workflows/app-test.yml b/.github/workflows/app-test.yml index bc90819..b15a121 100644 --- a/.github/workflows/app-test.yml +++ b/.github/workflows/app-test.yml @@ -1,10 +1,19 @@ -name: App test +name: Test application on: - push: - branches: [ master ] + workflow_dispatch: pull_request: - branches: [ master ] + paths: + - 'src/**' + +permissions: + id-token: write + statuses: write + checks: write + # may also be read + contents: write + pull-requests: write + actions: write jobs: test-app: @@ -22,9 +31,6 @@ jobs: distribution: 'temurin' java-version: '17' - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Setup .NET Core # Required to execute ReportGenerator uses: actions/setup-dotnet@v3 if: success() || failure() @@ -32,42 +38,45 @@ jobs: dotnet-version: 6.x dotnet-quality: 'ga' + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Test app run: ./gradlew test - - name: Get coverage - if: success() || failure() - run: ./gradlew jacocoTestReport - - - name: Generate test report - uses: dorny/test-reporter@v1.6.0 - if: success() || failure() - with: - name: Test results - path: 'build/test-results/test/*.xml' - reporter: java-junit - fail-on-error: false - - - name: Generate code coverage report - uses: danielpalme/ReportGenerator-GitHub-Action@5.1.25 - if: success() || failure() - with: - reports: build/reports/xml/jacoco - targetdir: coveragereport - reporttypes: MarkdownSummaryGithub - sourcedirs: src/main/java - title: 'Code Coverage' - - - name: Publish code coverage report as job summary - if: success() || failure() - run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY - - - name: Publish code coverage report as PR comment - uses: madrapps/jacoco-report@v1.6.1 - if: github.event_name == 'pull_request' && (success() || failure()) - with: - paths: | - ${{ github.workspace }}/build/reports/xml/jacoco - min-coverage-overall: 80 - min-coverage-changed-files: 80 - title: Coverage Report \ No newline at end of file +# - name: Get coverage +# if: success() || failure() +# run: ./gradlew jacocoTestReport +# +# - name: Generate test report +# uses: dorny/test-reporter@v1.6.0 +# if: success() || failure() +# with: +# name: Test results +# path: 'build/test-results/test/*.xml' +# reporter: java-junit +# fail-on-error: false +# +# - name: Generate code coverage report +# uses: danielpalme/ReportGenerator-GitHub-Action@5.1.25 +# if: success() || failure() +# with: +# reports: build/reports/xml/jacoco +# targetdir: coveragereport +# reporttypes: MarkdownSummaryGithub +# sourcedirs: src/main/java +# title: 'Code Coverage' +# +# - name: Publish code coverage report as job summary +# if: success() || failure() +# run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY +# +# - name: Publish code coverage report as PR comment +# uses: madrapps/jacoco-report@v1.6.1 +# if: github.event_name == 'pull_request' && (success() || failure()) +# with: +# paths: | +# ${{ github.workspace }}/build/reports/xml/jacoco +# min-coverage-overall: 80 +# min-coverage-changed-files: 80 +# title: Coverage Report \ No newline at end of file From 5a2a18ec1ca9a6cc84fb96ea7ef6dda7111c0a0d Mon Sep 17 00:00:00 2001 From: "neha.puraswani" Date: Thu, 26 Oct 2023 16:00:25 +0530 Subject: [PATCH 2/2] feat(app-test.yaml): Update github workflow --- .github/workflows/{app-test.yml => test-application.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{app-test.yml => test-application.yml} (100%) diff --git a/.github/workflows/app-test.yml b/.github/workflows/test-application.yml similarity index 100% rename from .github/workflows/app-test.yml rename to .github/workflows/test-application.yml