From 2dc328610522f8bdfffaf1c683e1fb8ed4889608 Mon Sep 17 00:00:00 2001 From: Spencer Connaughton Date: Tue, 9 Jan 2024 14:25:37 -0500 Subject: [PATCH] Switch to Bazelisk. --- .bazelversion | 1 + .github/workflows/build.yml | 9 ++++++--- README.md | 6 ++++++ tools/install_deps.sh | 38 ------------------------------------- 4 files changed, 13 insertions(+), 41 deletions(-) create mode 100644 .bazelversion delete mode 100755 tools/install_deps.sh diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000..19b860c --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +6.4.0 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5eb0b2f..aaf8b73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,10 +19,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Install bazel - run: tools/install_deps.sh + - name: Mount bazel cache + uses: actions/cache@v3 + with: + path: "~/.cache/bazel" + key: bazel - name: Run tests run: tools/run_tests.sh diff --git a/README.md b/README.md index 326e3b6..665332b 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ with [Bazel](https://bazel.build). Setup ----- +Make sure Bazel is installed on your system. See the [Bazel +documentation](https://docs.bazel.build/versions/master/install.html) for +platform-specific instructions. We recommend using [Bazelisk]( +https://bazel.build/install/bazelisk.html) to ensure you are using a supported +version. + To use the Dart rules, add the following to your `WORKSPACE` file to add the external repositories for the Dart toolchain: diff --git a/tools/install_deps.sh b/tools/install_deps.sh deleted file mode 100755 index 2ff7f21..0000000 --- a/tools/install_deps.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -BAZEL_VERSION=4.0.0 - -linux_install() { - echo "============================================================" - echo "Installing Bazel $BAZEL_VERSION on Linux" - echo "============================================================" - - sudo apt -y update - sudo apt -y install apt-transport-https curl gnupg - curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg - sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ - echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list - sudo apt update - sudo apt -y install bazel-$BAZEL_VERSION - exit 0 -} - -macos_install() { - echo "============================================================" - echo "Installing Bazel $BAZEL_VERSION on macOS" - echo "============================================================" - - curl -fLO "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh" - chmod +x "bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh" - sudo ./bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh - exit 0 -} - -# Main entry point. -case "`uname -s`" in - Linux*) linux_install;; - Darwin*) macos_install;; -esac - -echo "ERROR: unknown operating system" -exit 1