CI / check (push) Canceled after 0s
Debug builds are signed with a public test key committed as app/test-debug.keystore (standard debug passwords, .debug application id only). A runner's own debug key is new each run, so every test build used to need the one before it uninstalled -- and a sign-in with it. The version name carries GITHUB_RUN_NUMBER (1.0.0-beta.1-debug.42), and the updater compares only what is before "-debug". ci.yml uploads llembas-android-debug-<run> with the full and fdroid debug APKs named by run and commit, and their SHA256SUMS. release.yml passes --prerelease for a tag with a suffix: beta.1's GitHub Release had to be marked by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
75 lines
2.4 KiB
YAML
75 lines
2.4 KiB
YAML
name: CI
|
||
|
||
on:
|
||
push:
|
||
branches: [main, dev]
|
||
pull_request:
|
||
|
||
permissions:
|
||
contents: read
|
||
|
||
jobs:
|
||
check:
|
||
runs-on: ubuntu-24.04
|
||
timeout-minutes: 40
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Nothing private in the repository
|
||
run: scripts/hygiene.sh
|
||
|
||
- name: Generated files match their sources
|
||
run: |
|
||
python3 scripts/fetch-tokens.py # Tokens.kt matches tokens.lock.json
|
||
python3 scripts/fetch-contract.py # contract/ matches contract/lock.json
|
||
python3 scripts/gen-strings.py --check
|
||
|
||
- uses: actions/setup-java@v4
|
||
with:
|
||
distribution: temurin
|
||
java-version: 17
|
||
|
||
- name: ktlint (signature-checked)
|
||
run: |
|
||
curl -sSfL -o ktlint https://github.com/pinterest/ktlint/releases/download/1.8.0/ktlint
|
||
echo "a3fd620207d5c40da6ca789b95e7f823c54e854b7fade7f613e91096a3706d75 ktlint" | sha256sum -c
|
||
chmod +x ktlint
|
||
./ktlint "app/src/**/*.kt" "*.kts" "app/*.kts"
|
||
|
||
- uses: gradle/actions/wrapper-validation@v4
|
||
|
||
- uses: gradle/actions/setup-gradle@v4
|
||
|
||
- name: Unit tests and both builds
|
||
run: ./gradlew --no-daemon testFullDebugUnitTest assembleFullDebug assembleFdroidDebug
|
||
|
||
- name: Android lint (report only, for now)
|
||
run: ./gradlew --no-daemon lintFullDebug
|
||
continue-on-error: true
|
||
|
||
# The test build a tester installs (Actions › this run › Artifacts): debug-signed with the
|
||
# repository's public test key, so each one installs over the last. `full` is the one to
|
||
# use; `fdroid` is the same app without the updater.
|
||
- name: Name the test builds
|
||
run: |
|
||
mkdir test-builds
|
||
short="${GITHUB_SHA::7}"
|
||
cp app/build/outputs/apk/full/debug/app-full-debug.apk "test-builds/llembas-android-debug-$GITHUB_RUN_NUMBER-$short.apk"
|
||
cp app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk "test-builds/llembas-android-debug-$GITHUB_RUN_NUMBER-$short-fdroid.apk"
|
||
(cd test-builds && sha256sum *.apk > SHA256SUMS)
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
with:
|
||
name: llembas-android-debug-${{ github.run_number }}
|
||
path: test-builds/
|
||
if-no-files-found: error
|
||
|
||
- uses: actions/upload-artifact@v4
|
||
if: always()
|
||
with:
|
||
name: reports
|
||
path: |
|
||
app/build/reports/
|
||
app/build/test-results/
|
||
if-no-files-found: ignore
|