-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (62 loc) · 2.49 KB
/
Copy pathci.yml
File metadata and controls
74 lines (62 loc) · 2.49 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Android CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
gradle-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
validate-wrappers: true
# 2.0 renamed the package. A half-landed rename leaves the tree carrying two brands, which is
# worse than either end state, so fail the build rather than let one drift back in.
#
# Production code only. LICENSE, NOTICE.md and the change record must keep naming upstream -
# the licence requires it - and the backup tests name the old preferences file on purpose,
# because restoring a backup taken before 2.0 is a case that has to keep working.
#
# Comment lines are exempt. What must not drift back is a LIVE identifier; the migration
# code cannot be explained without naming what it migrates from, and every such comment
# would otherwise have to be bought off with another entry in the filename filter.
- name: No upstream identifiers outside the attribution files
run: |
if grep -rn --binary-files=without-match \
-e 'it\.palsoftware' -e 'pastiera_prefs' \
app/src/main app/build.gradle.kts app/*.pro .github \
| grep -vE 'SettingsMigration.kt|workflows/ci.yml' \
| grep -vE '^[^:]+:[0-9]+:[[:space:]]*(\*|//|/\*|#)' ; then
echo "::error::Upstream identifiers found outside the attribution files."
exit 1
fi
- name: Unit tests
run: ./gradlew :app:testDebugUnitTest
- name: Lint
run: ./gradlew :app:lintDebug
# The sideload build runs the same R8 pipeline as the shipped build without needing the
# signing key, so ProGuard breakage shows up here rather than on release day.
- name: Assemble debug and sideload
run: ./gradlew :app:assembleDebug :app:assembleSideload
- name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: reports
path: |
app/build/reports/lint-results-debug.html
app/build/reports/tests/testDebugUnitTest
if-no-files-found: ignore