Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
build:bb --bes_results_url=https://app.buildbuddy.io/invocation/
build:bb --bes_backend=grpcs://remote.buildbuddy.io
build:bb --remote_cache=grpcs://remote.buildbuddy.io
build:bb --remote_timeout=3600
build:bb --experimental_remote_cache_compression
build:bb --experimental_remote_cache_compression_threshold=100
build:bb --workspace_status_command=$(pwd)/workspace_status.sh

run -c opt --show_loading_progress=false --show_progress=false --ui_event_filters=error
run:verbose -c dbg --show_loading_progress=true --show_progress=true --ui_event_filters=info,error,debug
# https://github.com/mockito/mockito/issues/1879
test --sandbox_tmpfs_path=/tmp

try-import /tmp/bb.bazelrc
18 changes: 15 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ jobs:
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v4
- name: Write BuildBuddy config
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: echo "build:bb --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY" > /tmp/bb.bazelrc
- name: Run bazel-diff tests
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=true
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=true --config=bb
test-jre21:
runs-on: ubuntu-latest
steps:
Expand All @@ -41,8 +45,12 @@ jobs:
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v4
- name: Write BuildBuddy config
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: echo "build:bb --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY" > /tmp/bb.bazelrc
- name: Run bazel-diff tests
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=false
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=false --config=bb
test-jre11-run-example:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -85,8 +93,12 @@ jobs:
- name: Setup Bazelisk
run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin
- uses: actions/checkout@v4
- name: Write BuildBuddy config
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: echo "build:bb --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY" > /tmp/bb.bazelrc
- name: Build deployable JAR
run: ~/go/bin/bazelisk build //cli:bazel-diff_deploy.jar
run: ~/go/bin/bazelisk build //cli:bazel-diff_deploy.jar --config=bb
- uses: actions/upload-artifact@v4
with:
name: bazel-diff_deploy.jar
Expand Down
29 changes: 29 additions & 0 deletions workspace_status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# This script will be run bazel when building process starts to
# generate key-value information that represents the status of the
# workspace. The output should be like
#
# KEY1 VALUE1
# KEY2 VALUE2
#
# If the script exits with non-zero code, it's considered as a failure
# and the output will be discarded.

set -eo pipefail # exit immediately if any command fails.

function remove_url_credentials() {
which perl >/dev/null && perl -pe 's#//.*?:.*?@#//#' || cat
}

repo_url=$(git config --get remote.origin.url | remove_url_credentials)
echo "REPO_URL $repo_url"

commit_sha=$(git rev-parse HEAD)
echo "COMMIT_SHA $commit_sha"

git_branch=$(git rev-parse --abbrev-ref HEAD)
echo "GIT_BRANCH $git_branch"

git_tree_status=$(git diff-index --quiet HEAD -- && echo 'Clean' || echo 'Modified')
echo "GIT_TREE_STATUS $git_tree_status"
Loading