-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
110 lines (95 loc) · 3.21 KB
/
action.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
name: ros2wasm-builder
description: "Cross-compiles ROS 2 packages to WASM"
branding:
icon: "box"
color: "yellow"
inputs:
package:
description: "Target package"
type: string
default: "rmw_wasm_cpp"
required: true
ros_distro:
description: "ROS 2 distribution"
type: string
default: "humble"
required: true
debug_mode:
description: "Debug mode"
type: boolean
default: false
rmw_wasm:
description: "Clone rmw_wasm middleware"
type: boolean
default: true
runs:
using: composite
steps:
- name: Init simple action
shell: bash -eux {0}
run: echo "Packaging ${{ inputs.package }} for ${{ inputs.ros_distro }}"
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v12
with:
version: 3.1.45
- name: Verify emsdk
shell: bash -eux {0}
run: |
emcc -v
find $EMSDK -iname "upstream"
- name: Create ROS 2 workspace
shell: bash -eux {0}
run: mkdir -p ros-workspace/src
- name: Copy ROS 2 ${{ inputs.ros_distro }} packages and middleware
shell: bash -eux {0}
run: |
curl -s https://packagecloud.io/install/repositories/dirk-thomas/vcstool/script.deb.sh | sudo bash
sudo apt-get update
sudo apt-get install python3-vcstool
vcs import --input https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros_distro }}/ros2.repos ros-workspace/src
vcs import --input ${{ github.action_path }}/repos.yaml ros-workspace/src
- name: Checkout rmw_wasm middleware
if: ${{ inputs.rmw_wasm }}
uses: actions/checkout@v4
with:
repository: ihuicatl/rmw_wasm
path: ros-workspace/src/rmw_wasm
- name: Remove unsupported packages
shell: bash -eux {0}
run: |
cd ros-workspace/src
while read F; do rm -rf $F; done < ${{ github.action_path }}/unsupported.txt
- name: Apply patches
shell: bash -eux {0}
run: |
cd ros-workspace/src/ros2/rcutils
git apply ${{ github.action_path }}/patches/rcutils.patch
- name: Install patches for Iron only
shell: bash -eux {0}
if: ${{ inputs.ros_distro == 'iron' }}
run: |
cd ros-workspace/src/ros2/ros2_tracing/tracetools
git apply ${{ github.action_path }}/patches/iron_tracetools.patch
- name: Copy environment file to workspace
shell: bash -eux {0}
run: |
cp ${{ github.action_path }}/env.yaml ros-workspace/
- name: Create environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ros-workspace/env.yaml
init-shell: bash
cache-environment: true
- name: Build package
shell: bash -el {0}
run: |
cd ros-workspace
if [${{ inputs.debug }}]; then ${{ github.action_path }}/blasm.sh -d -v -u ${{ inputs.package }}; else ${{ github.action_path }}/blasm.sh -u ${{ inputs.package }}; fi
- name: Upload artifacts for package
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.package }}-artifacts
path: |
ros-workspace/build/${{ inputs.package }}/*
ros-workspace/install/share/${{ inputs.package }}/*
ros-workspace/install/include/${{ inputs.package }}/*