-
Notifications
You must be signed in to change notification settings - Fork 1
189 lines (173 loc) · 5.23 KB
/
pr-check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
## Overview
#
# This reusable GitHub Actions workflow provides a comprehensive Continuous Integration (CI) pipeline
# for multi-platform mobile and desktop applications, specifically designed for projects using Gradle and Java/Kotlin.
#
### Key Features
# - Automated code quality checks
# - Dependency management and verification
# - Cross-platform desktop application builds (Windows, Linux, MacOS)
# - Android APK build generation
# - Artifact generation and storage
#
### Workflow Jobs
# 1. **Setup**: Prepares the build environment
# - Checks out repository code
# - Sets up Java 17
# - Configures Gradle
# - Manages dependency caching
#
# 2. **Code Quality Checks**:
# - Build logic verification
# - Code formatting checks (Spotless)
# - Static code analysis (Detekt)
#
# 3. **Dependency Guard**:
# - Verifies dependencies against baseline
# - Prevents unauthorized dependency changes
# - Supports automatic baseline updates
#
# 4. **Android App Build**:
# - Builds debug APK for demo flavor
# - Uploads APK artifacts
#
# 5. **Desktop App Build**:
# - Builds applications for Windows, Linux, and MacOS
# - Generates platform-specific executables and packages
#
### Prerequisites
# - Java 17
# - Gradle
# - Configured build scripts for:
# - Android module
# - Desktop module
# - Installed Gradle plugins:
# - Spotless
# - Detekt
# - Dependency Guard
#
### Configuration Parameters
# The workflow requires two input parameters:
#
# | Parameter | Description | Type | Required |
# |-----------|-------------|------|----------|
# | `android_package_name` | Name of the Android project module | String | Yes |
# | `desktop_package_name` | Name of the Desktop project module | String | Yes |
#
### Usage Example
# ```yaml
# name: PR Checks
# Trigger conditions for the workflow
# on:
# push:
# branches: [ dev ] # Runs on pushes to dev branch
# pull_request: # Runs on all pull requests
#
# # Concurrency settings to prevent multiple simultaneous workflow runs
# concurrency:
# group: pr-${{ github.ref }}
# cancel-in-progress: true # Cancels previous runs if a new one is triggered
#
# permissions:
# contents: write
#
# jobs:
# pr_checks:
# name: PR Checks
# uses: openMF/mifos-mobile-github-actions/.github/workflows/pr-check.yaml@main
# secrets: inherit
# with:
# android_package_name: 'mifospay-android'
# desktop_package_name: 'mifospay-desktop'
# ```
#
# GitHub Actions workflow for continuous integration of Mobile-Wallet project
# Runs on master and dev branches to ensure code quality and build stability
name: Debug Build & PR Checks
# Trigger conditions for the workflow
on:
workflow_call:
inputs:
android_package_name:
description: 'Name of the Android project module'
type: string
required: true
desktop_package_name:
description: 'Name of the Desktop project module'
type: string
required: true
web_package_name:
description: 'Name of the Web project module'
type: string
required: true
ios_package_name:
description: 'Name of the iOS project module'
type: string
required: true
build_ios:
description: 'Build iOS Application'
type: boolean
required: false
default: true
# Concurrency settings to prevent multiple simultaneous workflow runs
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true # Cancels previous runs if a new one is triggered
jobs:
checks:
name: Static Analysis Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Static Analysis Check
uses: openMF/kmp-static-analysis-check-action@v1.0.0
build_android_app:
name: Build Android Application
needs: [ checks ]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Android App
uses: openMF/kmp-build-android-app-action@v1.0.1
with:
android_package_name: ${{ inputs.android_package_name }}
build_desktop_app:
name: Build Desktop Application
needs: [ checks ]
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build Desktop App
uses: openMF/kmp-build-desktop-app-action@v1.0.0
with:
desktop_package_name: ${{ inputs.desktop_package_name }}
build_type: 'Debug'
build_web_app:
name: Build Web Application
needs: [ checks ]
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build Web App
uses: openMF/kmp-build-web-app-action@v1.0.0
with:
web_package_name: ${{ inputs.web_package_name }}
build_ios_app:
name: Build iOS App
needs: [ checks ]
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build iOS App
if: ${{ inputs.build_ios }}
uses: openMF/kmp-build-ios-app-action@v1.0.0