Skip to content

Commit 2c20fa6

Browse files
committed
Add CI workflows
Signed-off-by: Carlosespicur <carlosespicur@proton.me>
1 parent 8dabbed commit 2c20fa6

9 files changed

Lines changed: 271 additions & 0 deletions

File tree

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: micro-ROS/micro_ros_tivac_launchpad_app/.github/actions/install_apt_packages@hotfix/fix-rsync-errors
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+
shell: bash
35+
36+
- name: Install Python packages
37+
run: |
38+
source ${{ inputs.venv-path }}/bin/activate
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: micro-ROS/micro_ros_tivac_launchpad_app/.github/actions/install_apt_packages@hotfix/fix-rsync-errors
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: humble

.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: jazzy

.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: kilted

.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: Install APT packages
23+
uses: micro-ROS/micro_ros_tivac_launchpad_app/.github/actions/install_apt_packages@hotfix/fix-rsync-errors
24+
with:
25+
packages: "build-essential cmake gcc-arm-none-eabi"
26+
use-sudo: "true"
27+
use-update: "true"
28+
29+
- name: Setup python
30+
uses: actions/setup-python@v6
31+
with:
32+
python-version: "3.12"
33+
34+
- name: Install required python packages
35+
uses: micro-ROS/micro_ros_tivac_launchpad_app/.github/actions/install_python_packages@hotfix/fix-rsync-errors
36+
with:
37+
packages: "catkin_pkg lark-parser empy colcon-common-extensions"
38+
python-version: "3.12"
39+
use-sudo: "true"
40+
41+
- name: Sync repository
42+
uses: actions/checkout@v5
43+
with:
44+
ref: ${{ inputs.branch }}
45+
submodules: recursive
46+
47+
- name: Install TivaWare SDK
48+
uses: micro-ROS/micro_ros_tivac_launchpad_app/.github/actions/install_sdk@hotfix/fix-rsync-errors
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: rolling

0 commit comments

Comments
 (0)