From 5bdfafd5fed805763b5275959590fd4be8c673e9 Mon Sep 17 00:00:00 2001
From: Saravana
Date: Thu, 19 Sep 2024 21:55:13 +0200
Subject: [PATCH] Testing coverage diff 1 (#18)
* Revert "Revert "Testing main flow" (#14)"
This reverts commit e83645c5dcc8a5033ca7e1b72d08806b27b0a8c4.
* Testing workflow summary - 1
* Testing workflow summary - 2
* Testing workflow summary - 3
* Testing workflow summary - 4
* Test more events
* Add workflow_run
* Add workflow_run another
* Add second_workflow
---
.github/workflows/first_workflow.yml | 22 +++++++++++++
.github/workflows/second_workflow.yml | 46 +++++++++++++++++++++++++++
2 files changed, 68 insertions(+)
create mode 100644 .github/workflows/first_workflow.yml
create mode 100644 .github/workflows/second_workflow.yml
diff --git a/.github/workflows/first_workflow.yml b/.github/workflows/first_workflow.yml
new file mode 100644
index 0000000..ad7a363
--- /dev/null
+++ b/.github/workflows/first_workflow.yml
@@ -0,0 +1,22 @@
+name: FirstWorkflow
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ schedule:
+ - cron: '*/5 * * * *' # Runs every 5 minutes
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 17
+ uses: actions/setup-java@v1
+ with:
+ java-version: 17
+
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
diff --git a/.github/workflows/second_workflow.yml b/.github/workflows/second_workflow.yml
new file mode 100644
index 0000000..98614b9
--- /dev/null
+++ b/.github/workflows/second_workflow.yml
@@ -0,0 +1,46 @@
+name: SecondWorkflow
+
+on:
+ workflow_run:
+ workflows: ["FirstWorkflow"]
+ types:
+ - completed # This triggers only when the previous workflow completes successfully
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 17
+ uses: actions/setup-java@v1
+ with:
+ java-version: 17
+
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+
+ - name: Run Module Coverage
+ run: ./gradlew prodNormalDebugCoverage debugCoverage
+
+ - name: Jacoco Report to PR
+ id: jacoco
+ uses: madrapps/jacoco-report@more-events
+ with:
+ paths: |
+ ${{ github.workspace }}/**/build/reports/jacoco/**/**.xml,
+ ${{ github.workspace }}/**/build/reports/jacoco/**/**.xml
+ token: ${{ secrets.GITHUB_TOKEN }}
+ min-coverage-overall: 45
+ min-coverage-changed-files: 84
+ title: '# :lobster: `Coverage Report`'
+ update-comment: true
+ comment-type: 'both'
+ pass-emoji: ':green_circle:'
+ fail-emoji: ':red_circle:'
+ continue-on-error: true
+ debug-mode: true
+
+ - name: Get the Coverage info
+ run: |
+ echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
+ echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"