Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Latest commit

 

History

History
110 lines (78 loc) · 3.19 KB

README.md

File metadata and controls

110 lines (78 loc) · 3.19 KB

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.