-
Notifications
You must be signed in to change notification settings - Fork 30
113 lines (109 loc) · 3.11 KB
/
ci.yaml
File metadata and controls
113 lines (109 loc) · 3.11 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: build_and_test
on:
push:
tags:
- '*'
branches:
- main
- humble
- jazzy
- '*-devel'
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- '*'
workflow_dispatch:
# Do not run multiple jobs for the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
timeout-minutes: 15
strategy:
matrix:
ros_distro: [humble, jazzy, kilted, rolling]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: mujoco_ros2_control
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: docker/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
target: mujoco_ros
build-args: |
ROS_DISTRO=${{ matrix.ros_distro }}
push: false
load: true
cache-from: type=gha,scope=ros-${{ matrix.ros_distro }}
cache-to: type=gha,mode=max,scope=ros-${{ matrix.ros_distro }}
- name: Run tests
run: |
docker run --rm \
${{ steps.meta.outputs.tags }} \
bash -c "
colcon test &&
colcon test-result --verbose
"
pixi_jazzy_build_and_test:
timeout-minutes: 15
env:
SCCACHE_DIR: ${{ github.workspace }}/.sccache
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build Docker image
uses: docker/build-push-action@v7
with:
context: .
file: docker/Dockerfile.pixi
push: false
load: true
tags: mujoco_ros2_control_pixi:ci
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Cache sccache
uses: actions/cache@v5
with:
path: |
${{ env.SCCACHE_DIR }}
key: ${{ runner.os }}-sccache-${{ github.head_ref || github.ref_name }}
restore-keys: |
${{ runner.os }}-sccache-main
${{ runner.os }}-sccache-
# Run pixi jobs, and ensure the cache is world readable.
- name: Build and test in container
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-v ${{ github.workspace }}/.sccache:/workspace/.sccache \
-w /workspace \
-e SCCACHE_DIR=/workspace/.sccache \
mujoco_ros2_control_pixi:ci \
bash -c "
pixi run setup-colcon && \
pixi run build && \
pixi run test && \
pixi run test-result && \
chmod -R a+rwX /workspace/.sccache
"