Skip to content
Open
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
59 changes: 47 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,52 @@
version: 2
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference
version: 2.1

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/configuration-reference/#jobs
jobs:
build:
run-tests-without-build-cache:
# Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/configuration-reference/#executor-job
docker:
- image: us.gcr.io/livegrep/ci:11

- image: cimg/base:stable
# Add steps to the job
# See: https://circleci.com/docs/configuration-reference/#steps
steps:
- checkout
- restore_cache:
keys:
- bazel-cache
- run:
name: "Install Bazelisk"
command: |
#!/usr/bin/env bash
set -euxo pipefail

sudo curl -Lo /usr/local/bin/bazelisk "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64"
sudo chmod +x /usr/local/bin/bazelisk
sudo ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel
bazel --version
- run:
name: "Bitrise Build Cache"
command: |
#!/usr/bin/env bash
set -euxo pipefail

# download Bitrise Build Cache CLI
curl -sSfL 'https://raw.githubusercontent.com/bitrise-io/bitrise-build-cache-cli/main/install/installer.sh' | sh -s -- -b /tmp/bin -d

# run the CLI to enable Bitrise build cache for Bazel
/tmp/bin/bitrise-build-cache enable-for bazel
- run:
name: "bazel test //..."
command: |
bazel test //...
- run:
name: "bazel build //..."
command: |
bazel build //...

- run: ./.circleci/build.sh
- save_cache:
key: bazel-cache
paths:
- /root/.cache/bazel
# Orchestrate jobs using workflows
# See: https://circleci.com/docs/configuration-reference/#workflows
workflows:
tests:
jobs:
- run-tests-without-build-cache