Skip to content

Commit

Permalink
test out buildbuddy workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Hilgers committed May 27, 2024
1 parent 4479a66 commit 446cf3d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ build --remote_timeout=3600
build --spawn_strategy=remote,sandboxed
build --remote_executor=grpcs://remote.buildbuddy.io

build --host_platform=@buildbuddy_toolchain//:platform
build --platforms=@buildbuddy_toolchain//:platform
build --extra_execution_platforms=@buildbuddy_toolchain//:platform
build --crosstool_top=@buildbuddy_toolchain//:toolchain
build --extra_toolchains=@buildbuddy_toolchain//:cc_toolchain
build --define=EXECUTOR=remote
build:remote --host_platform=@buildbuddy_toolchain//:platform
build:remote --platforms=@buildbuddy_toolchain//:platform
build:remote --extra_execution_platforms=@buildbuddy_toolchain//:platform
build:remote --crosstool_top=@buildbuddy_toolchain//:toolchain
build:remote --extra_toolchains=@buildbuddy_toolchain//:cc_toolchain
build:remote --define=EXECUTOR=remote

build --remote_cache_compression
build --noslim_profile --experimental_profile_include_target_label --experimental_profile_include_primary_output
Expand Down
13 changes: 13 additions & 0 deletions buildbuddy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
actions:
- name: "Test all targets"
triggers:
push:
branches:
- "main" # <-- replace "main" with your main branch name
pull_request:
branches:
- "*"
container_image: "ubuntu-20.04" # <-- add this line
bazel_commands:
- "run --noenable_bzlmod //tools/workflow:workflow_setup"
- "test --config=remote --repo_env=ANDROID_HOME=/home/buildbuddy/workspace/.home/.android/sdk/ --repo_env=ANDROID_NDK_HOME=/home/buildbuddy/workspace/.home/.android/sdk/ndk/26.3.11579264/ //..."
4 changes: 4 additions & 0 deletions tools/workflow/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sh_binary(
name = "workflow_setup",
srcs = ["workflow_setup.sh"],
)
28 changes: 28 additions & 0 deletions tools/workflow/workflow_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -eo pipefail

install_jre() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install --yes openjdk-17-jre
}

sudo bash -c "$(declare -f install_jre); install_jre"

VERSION_LONG="10406996"
FILENAME="commandlinetools-linux-${VERSION_LONG}_latest.zip"
SHA256="8919e8752979db73d8321e9babe2caedcc393750817c1a5f56c128ec442fb540"

if [[ ! -d ~/.android/sdk ]]; then
wget -O "$FILENAME" "https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_LONG}_latest.zip"
echo "${SHA256} ${FILENAME}" >SHA256SUMS
sha256sum -c SHA256SUMS
mkdir -p ~/.android/sdk/cmdline-tools/
unzip $FILENAME -d ~/.android/sdk/tmp
mv ~/.android/sdk/tmp/cmdline-tools ~/.android/sdk/cmdline-tools/latest
fi

(yes || true) | ~/.android/sdk/cmdline-tools/latest/bin/sdkmanager --licenses

~/.android/sdk/cmdline-tools/latest/bin/sdkmanager "ndk;26.3.11579264" "build-tools;34.0.0" "platforms;android-34"

0 comments on commit 446cf3d

Please sign in to comment.