diff options
| author | Lena <lena@omega> | 2026-07-01 00:00:00 +0000 |
|---|---|---|
| committer | Lena <lena@omega> | 2026-07-13 22:00:29 +0000 |
| commit | 2aa6920fb1568249d2466fa1b13760d1a51c0e8f (patch) | |
| tree | 5cd196d2017228cac43f2574d559d9a59b123a47 /ci/test.sh | |
| parent | 2593151ca2c67256442ad25b074504e3ecd3371f (diff) | |
| download | rsend-2aa6920fb1568249d2466fa1b13760d1a51c0e8f.tar.gz | |
ci: pin toolchains and verify release artifacts
Checksum-pin every downloaded toolchain archive. Before publishing,
verify the APK was built from HEAD, the tag matches versionName,
apksigner passes, and the tree is clean; publish a sha256 sidecar
and treat published assets as immutable. Compare full unsigned APKs
in verify-repro and run the Android unit tests in CI.
Diffstat (limited to 'ci/test.sh')
| -rwxr-xr-x | ci/test.sh | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -1,12 +1,14 @@ #!/bin/sh -# Host-verifiable checks: pinned source checksum, Go formatting, vet, and tests -# (including the real-rsync-through-rsh end-to-end). Needs Go and rsync; no -# Android toolchain. This is what runs on every push. +# Full checks: source pins, Go formatting/vet/tests, real-rsync integration, +# and Android JVM tests. Requires the provisioned toolchain and host rsync. set -eu root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) . "$root/versions" +command -v rsync >/dev/null 2>&1 || { echo "ci: rsync is required" >&2; exit 1; } +command -v gradle >/dev/null 2>&1 || { echo "ci: gradle is required" >&2; exit 1; } + if [ -f "$root/rsync/rsync-${RSYNC_VERSION}.tar.gz" ]; then echo "ci: verifying pinned rsync checksum" ( cd "$root/rsync" && sha256sum -c "rsync-${RSYNC_VERSION}.tar.gz.sha256" ) @@ -16,15 +18,21 @@ fi # a shell file); fail loud if they drift. echo "ci: version pins" pin() { - grep -q "$2" "$root/$1" || { echo "ci: $1 does not pin '$2' (see versions)" >&2; exit 1; } + grep -Fq "$2" "$root/$1" || { echo "ci: $1 does not pin '$2' (see versions)" >&2; exit 1; } } pin build.gradle "version '${AGP_VERSION}'" pin build.gradle "version '${KOTLIN_VERSION}'" pin gradle/wrapper/gradle-wrapper.properties "gradle-${GRADLE_VERSION}-bin.zip" pin app/build.gradle "compileSdk ${ANDROID_PLATFORM}" +pin app/build.gradle "buildToolsVersion '${ANDROID_BUILD_TOOLS}'" pin app/build.gradle "minSdk ${ANDROID_MIN_SDK}" pin app/build.gradle "targetSdk ${ANDROID_TARGET_SDK}" -pin rsh/go.mod "^go ${GO_VERSION}" +pin rsh/go.mod "go ${GO_VERSION}" +pin app/build.gradle "androidx.core:core-ktx:${ANDROIDX_CORE_VERSION}" +pin app/build.gradle "androidx.appcompat:appcompat:${ANDROIDX_APPCOMPAT_VERSION}" +pin app/build.gradle "androidx.work:work-runtime-ktx:${ANDROIDX_WORK_VERSION}" +pin app/build.gradle "junit:junit:${JUNIT_VERSION}" +pin app/build.gradle "org.json:json:${JSON_VERSION}" echo "ci: gofmt" unformatted=$(gofmt -l "$root/rsh") @@ -40,4 +48,7 @@ echo "ci: go vet" echo "ci: go test" ( cd "$root/rsh" && go test ./... ) +echo "ci: Android unit tests" +( cd "$root" && gradle :app:testReleaseUnitTest ) + echo "ci: ok" |