-
Notifications
You must be signed in to change notification settings - Fork 18
/
.cirrus.yml
84 lines (81 loc) · 2.75 KB
/
.cirrus.yml
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
75
76
77
78
79
80
81
82
83
docker_builder:
name: Build
only_if: $CIRRUS_BRANCH != $CIRRUS_DEFAULT_BRANCH
version_script: docker --version
setup_script:
- docker buildx create --name multibuilder
- docker buildx use multibuilder
- docker buildx inspect --bootstrap
build_tools_script: |
docker buildx build --platform linux/amd64,linux/arm64 \
--tag ghcr.io/cirruslabs/android-sdk:tools \
sdk/tools
build_sdk_script: |
docker buildx build --platform linux/amd64,linux/arm64 \
--tag ghcr.io/cirruslabs/android-sdk:34 \
sdk/34
build_ndk_script: |
docker buildx build --platform linux/amd64,linux/arm64 \
--tag ghcr.io/cirruslabs/android-sdk:34-ndk \
sdk/34-ndk
docker_builder:
name: Push
only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH
env:
GITHUB_TOKEN: ENCRYPTED[!82ed873afdf627284305afef4958c85a8f73127b09978a9786ac521559630ea6c9a5ab6e7f8315abf9ead09b6eff6eae!]
version_script: docker --version
login_script:
- echo $GITHUB_TOKEN | docker login ghcr.io -u fkorotkov --password-stdin
setup_script:
- docker buildx create --name multibuilder
- docker buildx use multibuilder
- docker buildx inspect --bootstrap
build_tools_script: |
docker buildx build --platform linux/amd64,linux/arm64 --push \
--tag ghcr.io/cirruslabs/android-sdk:tools \
sdk/tools
build_sdk_script: |
docker buildx build --platform linux/amd64,linux/arm64 --push \
--tag ghcr.io/cirruslabs/android-sdk:34 \
sdk/34
build_ndk_script: |
docker buildx build --platform linux/amd64,linux/arm64 --push \
--tag ghcr.io/cirruslabs/android-sdk:34-ndk \
sdk/34-ndk
task:
name: Smoke Test
container:
dockerfile: sdk/tools/Dockerfile
cpu: 4
memory: 8G
kvm: "true"
env:
EMULATOR_IMAGE: system-images;android-34;aosp_atd;x86_64
setup_script: |
sdkmanager --install "platforms;android-34"
sdkmanager --install "build-tools;34.0.0"
clone_script: |
git clone https://github.com/android/testing-samples.git
install_android_image_script:
sdkmanager --install "$EMULATOR_IMAGE"
create_emulator_script: |
avdmanager -s create avd -n MyAVD -k "$EMULATOR_IMAGE"
cat << EOF >> ~/.android/avd/MyAVD.avd/config.ini
hw.cpu.ncore=2
hw.gpu.enabled=yes
hw.gpu.mode=swiftshader_indirect
hw.ramSize=3072
disk.dataPartition.size=6G
vm.heapSize=576
hw.lcd.density=440
hw.lcd.height=2220
hw.lcd.width=1080
EOF
start_emulator_background_script:
- $ANDROID_HOME/emulator/emulator @MyAVD -verbose -no-snapshot-save -no-window -noaudio -no-boot-anim -accel on
wait_for_emulator_script:
- android-wait-for-emulator
run_tests_script: |
cd testing-samples
cd runner/AndroidTestOrchestratorSample
./gradlew :app:connectedAndroidTest