Skip to content

Commit 6a1c374

Browse files
Fix rsync errors and add CI (backport #31) (#34)
* Fix rsync errors and add CI (#31) * Fix rsync errors Signed-off-by: Carlosespicur <carlosespicur@proton.me> * Add CI workflows Signed-off-by: Carlosespicur <carlosespicur@proton.me> * Use correct branch on pull request runs Signed-off-by: Carlosespicur <carlosespicur@proton.me> * Remove rsync installation from setup script Signed-off-by: Carlosespicur <carlosespicur@proton.me> * Review - Apply suggestions Signed-off-by: Carlosespicur <carlosespicur@proton.me> --------- Signed-off-by: Carlosespicur <carlosespicur@proton.me> (cherry picked from commit d516654) * Remove references to remote branches Signed-off-by: Carlosespicur <carlosespicur@proton.me> --------- Signed-off-by: Carlosespicur <carlosespicur@proton.me> Co-authored-by: Carlos Espinoza Curto <148376273+Carlosespicur@users.noreply.github.com> Co-authored-by: Carlosespicur <carlosespicur@proton.me>
1 parent b635551 commit 6a1c374

File tree

11 files changed

+281
-3
lines changed

11 files changed

+281
-3
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: install_apt_packages
2+
description: 'Install specified APT packages'
3+
4+
inputs:
5+
packages:
6+
description: 'A space-separated list of APT packages to install.'
7+
required: true
8+
use-sudo:
9+
description: 'Whether to use sudo for installation commands.'
10+
required: false
11+
default: 'true'
12+
use-update:
13+
description: 'Whether to run apt-get update before installing packages.'
14+
required: false
15+
default: 'true'
16+
17+
runs:
18+
using: composite
19+
steps:
20+
- name: Install APT packages
21+
run: |
22+
if [ "${{ inputs.use-sudo }}" = "true" ]; then
23+
SUDO="sudo"
24+
else
25+
SUDO=""
26+
fi
27+
28+
if [ "${{ inputs.use-update }}" = "true" ]; then
29+
$SUDO apt-get update
30+
fi
31+
32+
$SUDO apt-get install -y ${{ inputs.packages }}
33+
shell: bash
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: install_python_packages
2+
description: 'Install specified Python packages in a virtual environment'
3+
4+
inputs:
5+
packages:
6+
description: 'A space-separated list of Python packages to install.'
7+
required: true
8+
python-version:
9+
description: 'The Python version to use (e.g., 3.12).'
10+
required: true
11+
venv-path:
12+
description: 'The path where the virtual environment should be created.'
13+
required: false
14+
default: '.venv'
15+
use-sudo:
16+
description: 'Whether to use sudo for installation commands.'
17+
required: false
18+
default: 'true'
19+
20+
runs:
21+
using: composite
22+
steps:
23+
24+
- name: Install required APT packages
25+
uses: ./.github/actions/install_apt_packages
26+
with:
27+
packages: "python${{ inputs.python-version }}-venv"
28+
use-sudo: ${{ inputs.use-sudo }}
29+
use-update: "false"
30+
31+
- name: Setup environment
32+
run: |
33+
python${{ inputs.python-version }} -m venv ${{ inputs.venv-path }}
34+
echo PATH=${GITHUB_WORKSPACE}/.venv/bin:$PATH >> $GITHUB_ENV
35+
shell: bash
36+
37+
- name: Install Python packages
38+
run: |
39+
pip install ${{ inputs.packages }}
40+
shell: bash
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: install_sdk
2+
description: Generate the TivaWare for C Series SDK files
3+
4+
inputs:
5+
sdk_version:
6+
description: 'The SW-TM4C SDK version to install (See https://www.ti.com/tool/SW-TM4C#downloads).'
7+
required: true
8+
install_path:
9+
description: 'The path where the SDK should be installed.'
10+
required: true
11+
force_reinstall:
12+
description: 'Force reinstallation even if the SDK is already installed.'
13+
required: false
14+
default: 'false'
15+
use-sudo:
16+
description: 'Whether to use sudo for installation commands.'
17+
required: false
18+
default: 'true'
19+
20+
runs:
21+
using: composite
22+
steps:
23+
24+
- name: Install APT packages
25+
uses: ./.github/actions/install_apt_packages
26+
with:
27+
packages: "curl p7zip"
28+
use-sudo: ${{ inputs.use-sudo }}
29+
use-update: "false"
30+
31+
- name: Install TivaWare SDK files
32+
run: |
33+
SDK_VERSION="${{ inputs.sdk_version }}"
34+
INSTALL_PATH="${{ inputs.install_path }}"
35+
FORCE_REINSTALL="${{ inputs.force_reinstall }}"
36+
SDK_EXE="SDK-${SDK_VERSION}.exe"
37+
SDK_URL="https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-oCcDwnGrsI/${SDK_VERSION}/SW-TM4C-${SDK_VERSION}.exe"
38+
39+
if [ -d "$INSTALL_PATH" ] && [ "$FORCE_REINSTALL" != "true" ]; then
40+
echo "SDK already installed at $INSTALL_PATH. Skipping download and installation."
41+
exit 0
42+
fi
43+
44+
mkdir -p "$INSTALL_PATH"
45+
cd "$INSTALL_PATH"
46+
47+
echo "Downloading TivaWare SDK version $SDK_VERSION..."
48+
curl -L -o "$SDK_EXE" "$SDK_URL"
49+
50+
echo "Extracting SDK..."
51+
7z x "$SDK_EXE" -o"$INSTALL_PATH"
52+
53+
echo "Cleaning up..."
54+
rm "$SDK_EXE"
55+
56+
echo "TivaWare SDK version $SDK_VERSION installed at $INSTALL_PATH."
57+
shell: bash

.github/workflows/humble-ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CI (Humble)
2+
3+
on:
4+
push:
5+
branches: [ humble ]
6+
pull_request:
7+
branches: [ humble ]
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/reusable-ci.yml
12+
with:
13+
os: ubuntu-22.04
14+
branch: ${{ github.ref }}

.github/workflows/jazzy-ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CI (Jazzy)
2+
3+
on:
4+
push:
5+
branches: [ jazzy ]
6+
pull_request:
7+
branches: [ jazzy ]
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/reusable-ci.yml
12+
with:
13+
os: ubuntu-24.04
14+
branch: ${{ github.ref }}

.github/workflows/kilted.ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CI (Kilted)
2+
3+
on:
4+
push:
5+
branches: [ kilted ]
6+
pull_request:
7+
branches: [ kilted ]
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/reusable-ci.yml
12+
with:
13+
os: ubuntu-24.04
14+
branch: ${{ github.ref }}

.github/workflows/nightly-ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Nightly CI (all distros)
2+
3+
on:
4+
schedule:
5+
- cron: '59 23 * * *' # Runs every day at 23:59 UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
humble-ci:
10+
uses: ./.github/workflows/reusable-ci.yml
11+
with:
12+
branch: humble
13+
os: ubuntu-22.04
14+
jazzy-ci:
15+
uses: ./.github/workflows/reusable-ci.yml
16+
with:
17+
branch: jazzy
18+
os: ubuntu-24.04
19+
kilted-ci:
20+
uses: ./.github/workflows/reusable-ci.yml
21+
with:
22+
branch: kilted
23+
os: ubuntu-24.04
24+
rolling-ci:
25+
uses: ./.github/workflows/reusable-ci.yml
26+
with:
27+
branch: rolling
28+
os: ubuntu-24.04

.github/workflows/reusable-ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Reusable CI Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
description: "The OS to use for the workflow"
8+
required: true
9+
type: string
10+
branch:
11+
description: "The branch to use for the workflow"
12+
required: true
13+
type: string
14+
15+
jobs:
16+
build:
17+
runs-on: ${{ inputs.os }}
18+
strategy:
19+
fail-fast: false
20+
steps:
21+
22+
- name: Sync repository
23+
uses: actions/checkout@v5
24+
with:
25+
ref: ${{ inputs.branch }}
26+
submodules: recursive
27+
28+
- name: Install APT packages
29+
uses: ./.github/actions/install_apt_packages
30+
with:
31+
packages: "build-essential cmake gcc-arm-none-eabi rsync"
32+
use-sudo: "true"
33+
use-update: "true"
34+
35+
- name: Setup python
36+
uses: actions/setup-python@v6
37+
with:
38+
python-version: "3.12"
39+
40+
- name: Install required python packages
41+
uses: ./.github/actions/install_python_packages
42+
with:
43+
packages: "catkin_pkg lark-parser empy colcon-common-extensions"
44+
python-version: "3.12"
45+
use-sudo: "true"
46+
47+
- name: Install TivaWare SDK
48+
uses: ./.github/actions/install_sdk
49+
with:
50+
sdk_version: "2.1.4.178"
51+
install_path: "${{ github.workspace }}/tivaware_c_series"
52+
force_reinstall: "false"
53+
use-sudo: "true"
54+
55+
- name: Build project
56+
run: make -j$(nproc)
57+
shell: bash

.github/workflows/rolling-ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CI (Rolling)
2+
3+
on:
4+
push:
5+
branches: [ rolling ]
6+
pull_request:
7+
branches: [ rolling ]
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/reusable-ci.yml
12+
with:
13+
os: ubuntu-24.04
14+
branch: ${{ github.ref }}

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ This example application has been tested in TI Tiva™ C Series TM4C123GXL Launc
99

1010
## Dependencies
1111

12+
This component needs the following packages to setup Micro-ROS:
13+
14+
```bash
15+
sudo apt install -y rsync pip git gcc-arm-none-eabi cmake
16+
```
17+
1218
This component needs `colcon` and other Python 3 packages in order to build micro-ROS packages:
1319

1420
```bash

0 commit comments

Comments
 (0)