The existence of this action is completely unnecessary when basilisk project exists, consider using it instead.
Cons:
- no docker
- easier to install dependencies like clang #16
- bazelisk takes care of version updates #19
- actions/cache can be used to persist cache #23
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 //...
This actions allows you to run bazel commands.
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 //...
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. |
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
You can read more about GitHub actions in the documentation.