Skip to content

Commit 55d0e07

Browse files
committed
CI: verify branches before they can become a release
A push to the default branch here builds, signs and publishes an APK that Obtainium installs within minutes, so the default branch was the only place to find out that something did not compile. check.yml runs the same compile and unit tests on every other branch and publishes nothing. build.yml now also ignores documentation and check.yml itself, so adding this file — and every README edit after it — stops cutting a release nobody asked for.
1 parent f65604c commit 55d0e07

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Build & Release APK
33
on:
44
push:
55
branches: [main]
6+
paths-ignore:
7+
- '**.md'
8+
- '.github/workflows/check.yml'
9+
- 'signing-fingerprint.txt'
610
workflow_dispatch:
711

812
permissions:

‎.github/workflows/check.yml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Check
2+
3+
# Compiles and tests without publishing anything.
4+
#
5+
# The point of this workflow is that a push to the default branch cuts a release, so the
6+
# default branch is a bad place to find out that something doesn't compile. Any other branch
7+
# runs this instead: the same build, minus the signing checks and the release.
8+
on:
9+
push:
10+
branches-ignore: [main]
11+
pull_request:
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: check-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
check:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-java@v4
24+
with:
25+
distribution: temurin
26+
java-version: '17'
27+
- uses: android-actions/setup-android@v3
28+
- uses: gradle/actions/setup-gradle@v4
29+
30+
- name: Unit tests
31+
run: ./gradlew :app:testDebugUnitTest --stacktrace
32+
33+
- name: Compile
34+
run: ./gradlew :app:assembleDebug --stacktrace
35+
36+
- name: Upload APK
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: LightPods-check-apk
40+
path: app/build/outputs/apk/debug/*.apk
41+
if-no-files-found: error

0 commit comments

Comments
 (0)