-
Notifications
You must be signed in to change notification settings - Fork 31
168 lines (144 loc) · 5.63 KB
/
ci.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: CI
on:
push:
branches: [main]
tags: ["**"]
pull_request:
branches: ["*"]
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install common dependencies
uses: ./.github/actions/common-deps
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "29.x"
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Ensure generated protobuf schemas are up to date
run: cargo run --bin foxglove-proto-gen && git diff --exit-code
- run: cargo fmt --all --check
- run: cargo build --verbose
- run: cargo clippy --no-deps --all-targets --tests -- -D warnings
- run: cargo test --features unstable --verbose
timeout-minutes: 10
- run: cargo publish --package foxglove --dry-run
- run: cargo publish --package foxglove
if: startsWith(github.ref, 'refs/tags/rust/v')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
registry-url: https://registry.npmjs.org
- name: Install Flatbuffer compiler
run: |
curl -LO https://github.com/google/flatbuffers/releases/download/v23.1.21/Linux.flatc.binary.clang++-12.zip
echo "359dbbf56153cc1b022170a228adfde4199f67dc Linux.flatc.binary.clang++-12.zip" | shasum -a 1 -c
unzip Linux.flatc.binary.clang++-12.zip
rm Linux.flatc.binary.clang++-12.zip
sudo mv flatc /usr/local/bin
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "29.x"
- run: yarn install --immutable
- run: yarn lint:ci
# must run this first because it copies the jsonschema directory
- run: yarn workspace @foxglove/schemas build
# typecheck remaining files in the repo
- run: yarn build
- run: yarn test
- name: Ensure generated files are up to date
run: |
yarn update-generated-files
git add --all
changes=$(git status --porcelain)
if [ -n "$changes" ]; then
echo "::error::The following generated files need to be updated. Run 'yarn update-generated-files' to update them."
echo "$changes"
echo ""
git diff --cached
exit 1
else
echo "Generated schemas are up to date!"
fi
- name: Validate Flatbuffer definitions
run: |
output=$(flatc --require-explicit-ids --ts -o /dev/null ./schemas/flatbuffer/*.fbs)
if [ -n "$output" ]; then
echo "::error::Flatbuffer schema compilation had warnings or errors. Fix them to proceed:"
echo "$output"
exit 1
fi
- name: Validate protobuf definitions
run: protoc --proto_path=schemas/proto schemas/proto/**/*.proto --descriptor_set_out=/dev/null
- name: Publish to NPM
if: startsWith(github.ref, 'refs/tags/typescript/v')
run: yarn npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
ros:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-noetic-ros-base-latest
ros_distribution: noetic
ros_version: 1
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-foxy-ros-base-latest
ros_distribution: foxy
ros_version: 2
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-galactic-ros-base-latest
ros_distribution: galactic
ros_version: 2
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
ros_distribution: humble
ros_version: 2
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest
ros_distribution: iron
ros_version: 2
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest
ros_distribution: rolling
ros_version: 2
name: "ROS ${{ matrix.ros_distribution }}"
container:
image: ${{ matrix.docker_image }}
steps:
- name: setup directories
run: mkdir -p ros_ws/src
- name: checkout
uses: actions/checkout@v4
with:
path: ros_ws/src
- name: build and test ros1
if: matrix.ros_version == 1
uses: ros-tooling/action-ros-ci@master
with:
package-name: foxglove_msgs
target-ros1-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ""
- name: Downgrade pydocstyle as a workaround for ament_lint error https://github.com/ament/ament_lint/pull/428
if: matrix.ros_distribution == 'galactic'
run: |
sudo pip install pydocstyle==6.1.1
- name: Downgrade pytest as a workaround for https://github.com/scientific-python/pytest-doctestplus/issues/240
if: matrix.ros_distribution == 'humble' || matrix.ros_distribution == 'iron' || matrix.ros_distribution == 'rolling'
run: |
sudo pip install pytest==8.0.2
- name: build and test ros2
if: matrix.ros_version == 2
uses: ros-tooling/action-ros-ci@master
with:
package-name: foxglove_msgs
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ""