-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75fc00d
commit 9672f37
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
task: | ||
name: seedvault-aosp | ||
timeout_in: 120m | ||
container: | ||
image: ubuntu:23.04 | ||
cpu: 8 | ||
memory: 32G | ||
build_script: | ||
- ./.github/scripts/build_aosp.sh | ||
always: | ||
seedvault_artifacts: | ||
path: "out/target/product/generic_arm64/system/priv-app/Seedvault/Seedvault.apk" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/usr/bin/env bash | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
apt-get update | ||
apt-get install -y git-core gnupg flex bison build-essential zip curl zlib1g-dev \ | ||
libc6-dev-i386 libncurses5 x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev \ | ||
libxml2-utils xsltproc unzip fontconfig python3 npm pip e2fsprogs python3-protobuf \ | ||
fonts-dejavu diffutils rsync ccache | ||
|
||
npm install --global yarn | ||
|
||
mkdir -p ~/bin | ||
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo | ||
chmod a+x ~/bin/repo | ||
ln -s /usr/bin/python3 /usr/bin/python | ||
export PATH=~/bin:$PATH | ||
|
||
set -e | ||
|
||
retry() { | ||
set +e | ||
local max_attempts=${ATTEMPTS-5} | ||
local timeout=${TIMEOUT-1} | ||
local attempt=0 | ||
local exitCode=0 | ||
|
||
while [[ $attempt < $max_attempts ]] | ||
do | ||
"$@" | ||
exitCode=$? | ||
|
||
if [[ $exitCode == 0 ]] | ||
then | ||
break | ||
fi | ||
|
||
echo "Failure! Retrying ($*) in $timeout.." | ||
sleep "${timeout}" | ||
attempt=$(( attempt + 1 )) | ||
timeout=$(( timeout * 2 )) | ||
done | ||
|
||
if [[ $exitCode != 0 ]] | ||
then | ||
echo "Failed too many times! ($*)" | ||
fi | ||
|
||
set -e | ||
|
||
return $exitCode | ||
} | ||
|
||
DEVICE=$1 | ||
TARGET=$2 | ||
export DISABLE_ROBO_RUN_TESTS=true | ||
|
||
# set git identity | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Seedvault" | ||
|
||
retry curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo | ||
chmod a+x ~/bin/repo | ||
|
||
# create custom manifest with Seedvault included | ||
git clone https://android.googlesource.com/platform/manifest.git | ||
mv manifest /aosp-manifest | ||
cd /aosp-manifest | ||
insert_text="<remote name=\"seedvault\" fetch=\"https://github.com/$CIRRUS_REPO_OWNER/\" revision=\"refs/heads/$CIRRUS_BRANCH\" />\n <project path=\"external/seedvault\" name=\"$CIRRUS_REPO_NAME\" remote=\"seedvault\" />" | ||
sed -i "/<manifest>/a ${insert_text}" "default.xml" | ||
|
||
mkdir -p /aosp | ||
cd /aosp | ||
retry yes | repo init -u /aosp-manifest -b 14 --depth=1 | ||
retry repo sync -c -j8 --fail-fast --force-sync | ||
|
||
# Cirrus CI seems to (possibly) reschedule tasks that aren't sending out logs for a while? | ||
while true; do echo "Still building..."; sleep 30; done & | ||
|
||
source build/envsetup.sh | ||
m -j8 Seedvault |