-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (59 loc) · 1.91 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build
on:
pull_request:
branches:
- main
workflow_dispatch:
env:
PACKAGE_NAME: maliput_malidrive
ROS_DISTRO: foxy
BAZEL_WS: bazel_ws
# Cancel previously running PR jobs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
bazel:
name: Compile and Test (Bazel)
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}-bazel-ci:latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: ${{ env.BAZEL_WS }}/${{ env.PACKAGE_NAME }}
# clone public dependencies
- name: vcs import
shell: bash
working-directory: ${{ env.BAZEL_WS }}
run: vcs import . < ${{ env.PACKAGE_NAME }}/.github/dependencies.repos
- name: Check if dependencies have a matching branch
shell: bash
working-directory: ${{ env.BAZEL_WS }}
run: ./${PACKAGE_NAME}/.github/try_vcs_checkout ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
- name: Update the dependent modules to use the local checkouts instead of branch
shell: bash
working-directory: ${{ env.BAZEL_WS }}/${{ env.PACKAGE_NAME }}
run: |
echo 'local_path_override(module_name="maliput", path="../maliput")' >> ./MODULE.bazel
- name: Build
shell: bash
working-directory: ${{ env.BAZEL_WS }}/${{ env.PACKAGE_NAME}}
run: |
bazel build //...
bazel test //...
cmake:
name: Compile and Test (CMake)
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
id: action_ros_ci_step
with:
package-name: ${{ env.PACKAGE_NAME }}
target-ros2-distro: ${{ env.ROS_DISTRO }}
vcs-repo-file-url: ${GITHUB_WORKSPACE}/.github/dependencies.repos