Migrate from `bazelbuild/setup-bazelisk` to `bazel-contrib/setup-bazel` in `ci.yml`

The `bazelbuild/setup-bazelisk` is archived since March 11, 2024: https://github.com/bazelbuild/setup-bazelisk
Instead, it is recommended to use `bazel-contrib/setup-bazel`: https://github.com/bazel-contrib/setup-bazel

The migration guide is available here: https://github.com/bazel-contrib/setup-bazel#migrating-from-bazelbuildsetup-bazelisk
1 file changed
tree: fb0fa32a527b691bdcc153207d0d7644f20974c5
  1. .bcr/
  2. .github/
  3. bazel/
  4. examples/
  5. tests/
  6. .bazelignore
  7. .bazelrc
  8. .bazelversion
  9. .gitignore
  10. BUILD.bazel
  11. CONTRIBUTING.md
  12. LICENSE
  13. MODULE.bazel
  14. README.md
  15. renovate.json
  16. update_versions.py
  17. WORKSPACE
  18. WORKSPACE.bzlmod
README.md

robolectric-bazel

This project provides build rules for integrating Robolectric into Bazel projects.

Releases


Installation

Follow instructions in the release notes from the release you use: https://github.com/robolectric/robolectric-bazel/releases

Usage

In your android_local_test targets in the BUILD files, depend on the Robolectric targets @maven//:org_robolectric_robolectric and @robolectric//bazel:android-all:

android_local_test(
    name = "greeter_activity_test",
    srcs = ["GreeterTest.java"],
    manifest = "TestManifest.xml",
    test_class = "com.example.bazel.GreeterTest",
    deps = [
        ":greeter_activity",
        "@maven//:org_robolectric_robolectric",
        "@robolectric//bazel:android-all",
    ],
)

Updating Android Versions

update-versions.py walks org.robolectric:android-all-instrumented on Maven Central and rewrites bazel/robolectric.bzl in place: it bumps the version and sha256 of any Android API group that has a newer release, and inserts new entries for any numeric API newer than the highest one currently listed.

./update-versions.py            # apply updates
./update-versions.py --dry-run  # preview without writing

Publishing Releases

A new release can be published by just pushing a tag.

Once the tag is pushed, GitHub Actions will build, test, and publish a release to both GitHub releases and the BCR.

Example:

git tag 4.11.1
git push origin 4.11.1