diff --git a/.github/workflows/build_esp32dev.yml b/.github/workflows/build_esp32dev.yml new file mode 100644 index 0000000..ae9a6ec --- /dev/null +++ b/.github/workflows/build_esp32dev.yml @@ -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 diff --git a/.github/workflows/build_nucleo_u575zi_q.yml b/.github/workflows/build_nucleo_u575zi_q.yml new file mode 100644 index 0000000..fee51fb --- /dev/null +++ b/.github/workflows/build_nucleo_u575zi_q.yml @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0805789 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 9ebc4ce..9c984d8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/platformio.ini b/platformio.ini index 717e4c1..19abab6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -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