Skip to content

Commit

Permalink
Merge pull request #1 from kaizoku-oh/ci
Browse files Browse the repository at this point in the history
Adding CI and badges
  • Loading branch information
kaizoku-oh authored Oct 22, 2024
2 parents 454b0c4 + b891e50 commit ec53139
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 2 deletions.
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

0 comments on commit ec53139

Please sign in to comment.