Skip to content

Commit 2a5892c

Browse files
committed
**build(ci): improve pull request workflow and gradle setup**
- renamed job to `Compile (app:assembleDebug)` for clarity - added concurrency control to cancel redundant runs - introduced `paths-ignore` and `permissions` for optimized triggers and security - validated Gradle wrapper for build integrity - switched JDK setup from Zulu to Temurin 17 - added Android SDK setup for better environment preparedness - improved Gradle caching strategy with read-only mode on PRs - removed obsolete `simple_compile` job and duplicate steps - updated workflow display name to “PR Checks” Affected file: `.github/workflows/pr_pre_check.yml` > GENERATE BY https://aicommit.app
1 parent d7b8edf commit 2a5892c

1 file changed

Lines changed: 45 additions & 35 deletions

File tree

.github/workflows/pr_pre_check.yml

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,58 @@
1-
name: Basic Check
2-
3-
env:
4-
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -XX:MaxMetaspaceSize=1g" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
5-
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon
1+
name: PR Checks
62

73
on:
84
pull_request:
9-
types: [opened,reopened,synchronize]
5+
types: [opened, reopened, synchronize]
106
branches:
117
- master
8+
paths-ignore:
9+
- '**/*.md'
10+
- 'fastlane/**'
11+
- 'static/**'
12+
- 'captures/**'
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
21+
1222
jobs:
13-
check:
14-
name: Check
23+
build:
24+
name: Compile (app:assembleDebug)
1525
runs-on: ubuntu-latest
26+
timeout-minutes: 30
27+
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
1628
steps:
17-
- uses: actions/checkout@v4
18-
- name: Skip duplicate actions
19-
uses: fkirc/skip-duplicate-actions@v5
20-
with:
21-
cancel_others: true
22-
- uses: actions/setup-java@v4
29+
- name: Checkout
30+
uses: actions/checkout@v4
2331
with:
24-
distribution: 'zulu'
25-
java-version: 17
26-
cache: 'gradle'
27-
- uses: gradle/actions/setup-gradle@v4
28-
with:
29-
gradle-version: wrapper
30-
gradle-home-cache-cleanup: true
31-
# - run: ./gradlew spotlessCheck
32-
simple_compile:
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v4
36-
with:
37-
fetch-depth: 0
38-
- uses: actions/setup-java@v4
32+
fetch-depth: 1
33+
persist-credentials: false
34+
35+
- name: Validate Gradle Wrapper
36+
uses: gradle/wrapper-validation-action@v2
37+
38+
- name: Set up JDK 17
39+
uses: actions/setup-java@v4
3940
with:
40-
distribution: 'zulu'
41-
java-version: 17
42-
cache: 'gradle'
43-
- uses: gradle/actions/setup-gradle@v4
41+
distribution: 'temurin'
42+
java-version: '17'
43+
44+
- name: Set up Android SDK
45+
uses: android-actions/setup-android@v3
46+
47+
- name: Set up Gradle
48+
uses: gradle/actions/setup-gradle@v4
4449
with:
4550
gradle-version: wrapper
51+
cache-read-only: ${{ github.event_name == 'pull_request' }}
4652
gradle-home-cache-cleanup: true
47-
- name: Build apk with Gradle
48-
run: ./gradlew :app:assembleDebug
53+
54+
- name: Make gradlew executable
55+
run: chmod +x ./gradlew
56+
57+
- name: Build debug APK (skip lint/tests)
58+
run: ./gradlew :app:assembleDebug -x lint -x test --stacktrace

0 commit comments

Comments
 (0)