Skip to content

gmhelmold/corelink-bazel-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoreLink + Bazel — 5-minute setup

This repo demonstrates CoreLink's remote build cache with a minimal Bazel 7+ workspace: 3 Go libraries, 1 binary, 1 test. Clone it, wire up your token, and watch the second bazel build //... finish in under a second.


5-step walkthrough

1. Install Bazel 7+

# macOS
brew install bazelisk

# Linux
curl -Lo bazelisk https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64
chmod +x bazelisk && sudo mv bazelisk /usr/local/bin/bazel

2. Sign up and get your PAT

Go to corelink.humangr.com, create an account, and copy your Personal Access Token (format: ct_xxxx…).

3. Install the CoreLink CLI and authenticate

curl -fsSL https://corelink-get.humangr.com | sh -s -- \
  --token=ct_xxx --region=ord

The CLI writes your token to ~/.config/corelink/credentials and sets CORELINK_TOKEN for your shell session.

4. This repo is already configured — just export your token

export CORELINK_TOKEN=ct_xxx   # or: source ~/.config/corelink/env
git clone https://github.com/humangr-labs/corelink-bazel-example
cd corelink-bazel-example

5. Build twice — the second run should be near-instant

# First build — compiles everything, populates the remote cache.
bazel build //... --config=corelink

# Second build — retrieves all outputs from CoreLink; should be sub-second.
bazel build //... --config=corelink

Expected output

First build (cold):

INFO: Analyzed 5 targets (30 packages loaded, 150 targets configured).
INFO: Found 5 targets...
INFO: 8 processes: 8 local.
INFO: Build completed successfully, 8 total actions

Second build (warm — all cache hits):

INFO: Analyzed 5 targets (0 packages loaded, 0 targets configured).
INFO: Found 5 targets...
INFO: Build completed successfully, 8 total actions, 8 remote cache hit

The key line: 8 remote cache hit — every action was served from CoreLink.


Repo layout

MODULE.bazel          # Bazel 7 bzlmod: rules_go 0.50.1
.bazelrc              # cache config; --config=corelink enables remote cache
lib/a/                # go_library: greeting helper
lib/b/                # go_library: version/banner
lib/c/                # go_library (deps a+b) + go_test
cmd/demo/             # go_binary (deps c)
.github/workflows/    # smoke.yml: build twice, assert cache hits

Tests & CI

bazel test //... --config=corelink

.github/workflows/smoke.yml builds twice and asserts all-cache-hit. Set CORELINK_TEST_TOKEN_CI secret in repo settings to enable it.


License: Apache-2.0 — © 2026 HuGR Labs

About

CoreLink + Bazel — 5-minute setup walkthrough

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors