blob: 2e6b14d4e6aaa68fee72d8acaa40cda895100f57 (
plain) (
blame)
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
|
#!/bin/sh
# 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" )
fi
# The gradle files and go.mod repeat pins from ./versions (gradle cannot source
# a shell file); fail loud if they drift.
echo "ci: version pins"
pin() {
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 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")
if [ -n "$unformatted" ]; then
echo "ci: gofmt needed for:" >&2
echo "$unformatted" >&2
exit 1
fi
echo "ci: go vet"
( cd "$root/rsh" && go vet ./... )
echo "ci: go test"
( cd "$root/rsh" && go test ./... )
echo "ci: Android unit tests"
( cd "$root" && gradle :app:testReleaseUnitTest )
echo "ci: ok"
|