Skip to content

nv-gha-runners/setup-bazel-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

setup-bazel-cache

Get configuration information to use the bazel-cache service deployed for use with NVIDIA's self-hosted runners.

Inputs

This action supports the following inputs:

Name Type Default Description
bazelrc-path string /tmp/bazelrc.nvidia Path to a file in .bazelrc format to append cache configuration to

Outputs

This action produces the following outputs:

Name Type Description
bazelrc-path string Path to a file in .bazelrc format with cache configuration
https-url string HTTPS URL to be passed to bazel <command> --remote_cache

Example

In your project's .bazelrc:

try-import /tmp/bazelrc.nvidia

In a GitHub Actions workflow file:

name: pr

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: linux-amd64-cpu4
    container:
      image: ubuntu:latest
    steps:
      - name: Install bazel
        run: # ... see https://bazel.build/install/ubuntu #
      - name: Set up bazel cache
        uses: nv-gha-runners/setup-bazel-cache@main
      - name: Build project
        run: bazel build

Alternatively, if you don't want to touch any .bazelrc files:

jobs:
  build:
    runs-on: linux-amd64-cpu4
    container:
      image: ubuntu:latest
    steps:
      - name: Install bazel
        run: # ... see https://bazel.build/install/ubuntu #
      - name: Set up bazel cache
        id: setup-bazel-cache
        uses: nv-gha-runners/setup-bazel-cache@main
      - name: Build project
        run: |
            bazel build --remote_cache="${{ steps.setup-bazel-cache.outputs.https-url }}"

About

GitHub Action for enabling bazel build cache on NVIDIA-managed CI runners

Resources

License

Stars

Watchers

Forks