-
Notifications
You must be signed in to change notification settings - Fork 28
144 lines (113 loc) · 4.86 KB
/
Copy pathci.yml
File metadata and controls
144 lines (113 loc) · 4.86 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
no-ros:
name: ROS-independent Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v15
- name: Setup Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v9
- name: Setup sccache
if: env.ACT != 'true'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Check Nix formatting
run: |
nix fmt -- --check flake.nix
- name: Check Markdown formatting
run: |
nix develop '.#noRos-ci' -c markdownlint '**/*.md'
- name: Check Rust formatting
run: |
nix develop '.#noRos-ci' -c cargo fmt --all -- --check
- name: Clippy (default workspace)
run: |
nix develop '.#noRos-ci' -c cargo clippy --lib --bins --tests -- -D warnings
- name: Check default workspace
run: |
nix develop '.#noRos-ci' -c cargo check
- name: Build default workspace
run: |
nix develop '.#noRos-ci' -c cargo build
- name: Build examples without ROS dependencies
run: |
nix develop '.#noRos-ci' -c cargo build --examples
- name: Run tests
run: |
nix develop '.#noRos-ci' -c cargo test
- name: Check ros-z-msgs with bundled messages (no ROS required)
run: |
nix develop '.#noRos-ci' -c cargo check -p ros-z-msgs
nix develop '.#noRos-ci' -c cargo check -p ros-z-msgs --features bundled_msgs
nix develop '.#noRos-ci' -c cargo check -p ros-z-msgs --features common_interfaces
- name: Build ros-z-msgs with individual bundled packages
run: |
nix develop '.#noRos-ci' -c cargo build -p ros-z-msgs --no-default-features --features std_msgs
nix develop '.#noRos-ci' -c cargo build -p ros-z-msgs --no-default-features --features geometry_msgs
nix develop '.#noRos-ci' -c cargo build -p ros-z-msgs --no-default-features --features sensor_msgs
nix develop '.#noRos-ci' -c cargo build -p ros-z-msgs --no-default-features --features nav_msgs
with-ros:
name: ROS-dependent Test (${{ matrix.distro }})
runs-on: ubuntu-latest
strategy:
matrix:
distro: [jazzy]
# distro: [jazzy, rolling] # Uncomment to test rolling when stable
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v15
with:
extra-conf: |
extra-substituters = https://ros.cachix.org
extra-trusted-public-keys = ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=
- name: Setup Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v9
- name: Setup Cachix
uses: cachix/cachix-action@v15
with:
name: ros
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
skipPush: true
- name: Setup sccache
if: env.ACT != 'true'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Check rcl-z
run: |
nix develop '.#${{ matrix.distro }}-ci' -c cargo check -p rcl-z
- name: Check ros-z-msgs (default bundled features)
run: |
nix develop '.#${{ matrix.distro }}-ci' -c cargo check -p ros-z-msgs
- name: Check ros-z-msgs with external messages
run: |
nix develop '.#${{ matrix.distro }}-ci' -c cargo check -p ros-z-msgs --features external_msgs
nix develop '.#${{ matrix.distro }}-ci' -c cargo check -p ros-z-msgs --features example_interfaces
- name: Check ros-z-msgs with all messages (bundled + external)
run: |
nix develop '.#${{ matrix.distro }}-ci' -c cargo check -p ros-z-msgs --features all_msgs
- name: Check with protobuf feature
run: |
nix develop '.#${{ matrix.distro }}-ci' -c cargo check -p ros-z -p ros-z-msgs --features ros-z/protobuf,ros-z-msgs/protobuf
- name: Check ros-z (with rcl-z feature)
run: |
nix develop '.#${{ matrix.distro }}-ci' -c cargo check -p ros-z --features rcl-z
- name: Build ROS message examples
run: |
nix develop '.#${{ matrix.distro }}-ci' -c cargo build -p ros-z-msgs
nix develop '.#${{ matrix.distro }}-ci' -c cargo build --examples
nix develop '.#${{ matrix.distro }}-ci' -c cargo build --example z_srvcli --features external_msgs
- name: Build protobuf demo
run: |
nix develop '.#${{ matrix.distro }}-ci' -c cargo build -p protobuf_demo
# FIXME: This requires the installation of rmw_zenoh_cpp triggering a build from source...
# - name: Run unit tests
# run: |
# nix develop .#ci -c cargo test --all-features