ngalaiko / bazel-action

A GitHub action to run @bazelbuild commands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DO NOT USE

The existence of this action is completely unnecessary when basilisk project exists, consider using it instead.

Cons:

name: CI

on:
  push: {}

jobs:
  build:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v1

    - name: Mount bazel cache
      uses: actions/cache@v1
      with:
        path: "/home/runner/.cache/bazel"
        key: bazel

    - name: Install bazelisk
      run: |
        curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
        mkdir -p "${GITHUB_WORKSPACE}/bin/"
        mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
        chmod +x "${GITHUB_WORKSPACE}/bin/bazel"

    - name: Test
      run: |
        "${GITHUB_WORKSPACE}/bin/bazel" test //...

    - name: Build
      run: |
        "${GITHUB_WORKSPACE}/bin/bazel" build //...

CI Status Docker Hub

Bazel Action

This actions allows you to run bazel commands.

How to use

Create a .github/workflows/workflow.yml file with the following contents:

on: push
name: My Action
jobs:
  checks:
    name: run
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master

    - name: run
      uses: ngalaiko/bazel-action/1.2.1@master
      with:
        args: build //...

with Arguments

Additional context can be passed to the bazel action with the with field. The following fields are supported:

with field Description
working_dir Sets the directory that bazel will run in.

bazel version

In order to speed up builds, ngalaiko/bazel-action/<version>@<tag> uses prebuilt images with installed bazel and all dependencies. Images are stored in the DockerHub.

If you need a specific bazel version, you can import it by changeing uses import path. For example:

uses: ngalaiko/bazel-action/2.0.0@master

or

uses: ngalaiko/bazel-action/1.2.1@master

If you need another version, please open an issue, or send a PR.

If you don't want to use a prebuild image, the action with the bazel's latest version is always accessible via

uses: ngalaiko/bazel-action@master

GitHub actions

You can read more about GitHub actions in the documentation.

About

A GitHub action to run @bazelbuild commands

License:MIT License


Languages

Language:Dockerfile 91.8%Language:Shell 8.2%