Repository navigation
53 lines (43 loc) · 1.85 KB
/
Copy pathandroid.yml
File metadata and controls
53 lines (43 loc) · 1.85 KB
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
name: Android CI
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
# CI 只需要读代码,显式收窄默认权限
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Set up JDK 17
uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4
with:
distribution: temurin
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@48b5f213c81028ace310571dc5ec0fbbca0b2947 # v4
- name: Build debug APK
# 跳过 lintVitalRelease:本机 Windows + AGP 8.7.2 下该任务长时间无进展(实测卡死),
# CI 一并跳过,避免流水线无意义地空转。
# 没有 app/google-services.json 也能构建:插件按文件是否存在决定是否启用。
run: |
chmod +x ./gradlew
./gradlew assembleDebug -x lintVitalRelease --console=plain
- name: Unit tests
# 只跑 JVM 纯函数测试(地址解析、HTML 清洗),不需要设备;覆盖改这些地方时最容易踩的回归
run: ./gradlew testDebugUnitTest --console=plain
- name: Lint (debug)
# 只跑 debug 变体:lint 结果用于拦截新引入的问题,不阻塞 release 构建。
# 存量问题固定在 app/lint-baseline.xml 基线里(已知项清单见 app/build.gradle.kts 的 lint 配置注释),
# 新增 error 仍会让这一步失败。
run: ./gradlew lintDebug --console=plain
- name: Upload debug APK
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: otsmail-debug
path: app/build/outputs/apk/debug/app-debug.apk
if-no-files-found: error