Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CI and badges #1

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/build_esp32dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build_esp32dev

on:
pull_request:
branches:
- main
- dev
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Build Docker image
run: |
docker build -t platformio-image .

- name: Run PlatformIO build
run: |
docker run --rm -v $(pwd):/workspace platformio-image platformio run --environment esp32dev
35 changes: 35 additions & 0 deletions .github/workflows/build_nucleo_u575zi_q.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build_nucleo_u575zi_q

on:
pull_request:
branches:
- main
- dev
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Build Docker image
run: |
docker build -t platformio-image .

- name: Run PlatformIO build
run: |
docker run --rm -v $(pwd):/workspace platformio-image platformio run --environment nucleo_u575zi_q
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use an official Python image as a base
FROM python:3.11-slim

# Set the working directory in the container
WORKDIR /workspace

# Install required system dependencies
RUN apt update && apt install -y \
curl \
git \
g++ \
cmake \
build-essential \
&& rm -rf /var/lib/apt/lists/*

# Download and install PlatformIO using the specified commands
RUN curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py \
&& python3 get-platformio.py \
&& rm get-platformio.py

# Add PlatformIO's binary directory to PATH
ENV PATH="/root/.platformio/penv/bin:${PATH}"

# Copy the current directory contents into the container at /workspace
COPY . /workspace

# Define the default command to run PlatformIO
CMD ["platformio", "--help"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# 🚀 Micro-ROS on PlatformIO

[![GitHub release](https://img.shields.io/github/v/release/kaizoku-oh/pio-micro-ros)](https://github.com/kaizoku-oh/pio-micro-ros/releases)
[![GitHub issues](https://img.shields.io/github/issues/kaizoku-oh/pio-micro-ros)](https://github.com/kaizoku-oh/pio-micro-ros/issues)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/kaizoku-oh/pio-micro-ros/blob/main/LICENSE)

------

[![GitHub Build workflow status - nucleo_u575zi_q](https://github.com/kaizoku-oh/pio-micro-ros/workflows/build_nucleo_u575zi_q/badge.svg)](https://github.com/kaizoku-oh/pio-micro-ros/actions/workflows/build_nucleo_u575zi_q.yml)
[![GitHub Build workflow status - esp32dev](https://github.com/kaizoku-oh/pio-micro-ros/workflows/build_esp32dev/badge.svg)](https://github.com/kaizoku-oh/pio-micro-ros/actions/workflows/build_esp32dev.yml)

## 🛠️ 0. Install OS dependencies

```bash
Expand Down
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ monitor_speed = 115200
monitor_dtr = 1
monitor_filters = direct

[env:arduino_nucleo_u575zi_q]
[env:nucleo_u575zi_q]
platform = ststm32
board = nucleo_u575zi_q

[env:arduino_esp32dev]
[env:esp32dev]
platform = espressif32
board = esp32dev
Loading