Skip to content

Add basic Bazel build/test CI matrix for Ubuntu #11

Add basic Bazel build/test CI matrix for Ubuntu

Add basic Bazel build/test CI matrix for Ubuntu #11

Workflow file for this run

name: Build/Test
on:
push:
branches:
- main
tags:
- "**"
pull_request:
branches:
- main
workflow_dispatch:
# only run one build doc workflow at a time, cancel any running ones
#concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
jobs:
build_test:
strategy:
matrix:
os:
- ubuntu
version:
- 20.04
- 22.04
runs-on: ${{ matrix.os }}-${{ matrix.version }}
steps:
- uses: actions/checkout@v3
- name: Specify the Bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: ${{ hashFiles('.bazelrc', '.bazelversion', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
- name: Build
# TODO(evan.flynn): uncomment once the rules are properly fixed
# run: bazel build //...
run: bazel build -- $(cat repos/config/bazel.repos | sed -e '/^[#r]/d' -e '/^ /d' -e 's%/%.%' -e 's% \(.*\):%@\1//...%' -e '/@ros2.rosidl/d' -e '/@ros2.rcl_interfaces/d' -e '/@ros2.common_interfaces/d')
- name: Test
run: bazel test //...