-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (93 loc) · 4.07 KB
/
pico-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
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
# The ROS robot project - Raspberry Pi Pico source code build workflow.
# Copyright 2024 Samyar Sadat Akhavi
# Written by Samyar Sadat Akhavi, 2024.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https: www.gnu.org/licenses/>.
name: Build Pico Source Code
on: push
jobs:
build_uros:
name: Build the micro-ROS library
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Copy FreeRTOS Kernel Import File
run: |
cp "Source Code/pico_ws/libfreertos/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/FreeRTOS_Kernel_import.cmake" \
"Source Code/pico_ws/FreeRTOS_Kernel_import.cmake"
- name: Generate Pico SDK Headers
uses: samyarsadat/Pico-Build-Action@v1
with:
source_dir: "Source Code/pico_ws"
output_dir: "build"
cmake_config_only: "true"
cmake_args: "-DCMAKE_BUILD_TYPE=Release"
# This step is required because of a bug in micro_ros_setup's firmware workspace creation script.
# This bug causes the script to fail if the path to the script's working directory contains spaces.
- name: Rename Source Code Directory
run: |
mv "Source Code/" "source_code/"
- name: Build MicroROS Library
id: build
uses: samyarsadat/MicroROS-Build-Action@v1
with:
microros_dir: "source_code/pico_ws/libmicroros"
clone_microros_setup: "false"
extra_build_packages: "rrp_pico_coms"
- name: Upload MicroROS Library Artifacts
uses: actions/upload-artifact@v4
with:
name: uros_library_artifacts
path: ${{steps.build.outputs.library_build_dir}}
if-no-files-found: error
build_pico:
name: Build the Pico source code
runs-on: ubuntu-latest
needs: build_uros
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download MicroROS Library Artifacts
uses: actions/download-artifact@v4
with:
name: uros_library_artifacts
path: "Source Code/pico_ws/libmicroros/firmware/build"
- name: Copy FreeRTOS Kernel Import File
run: |
cp "Source Code/pico_ws/libfreertos/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/FreeRTOS_Kernel_import.cmake" \
"Source Code/pico_ws/FreeRTOS_Kernel_import.cmake"
- name: Build Pico Source Code
id: build
uses: samyarsadat/Pico-Build-Action@v1
with:
source_dir: "Source Code/pico_ws"
output_dir: "build"
output_ext: "*.uf2 *.elf *.elf.map *.hex *.bin *.dis"
output_ignored_dirs: "src/lib"
cmake_args: "-DCMAKE_BUILD_TYPE=Release"
- name: Upload Pico Source Code Artifacts
uses: actions/upload-artifact@v4
with:
name: pico_binary_artifacts
path: ${{steps.build.outputs.output_dir}}
if-no-files-found: error