mirror of
https://github.com/lukstep/raspberry-pi-pico-docker-sdk.git
synced 2025-12-22 18:45:56 +03:00
Compare commits
3 Commits
v1.1.0
...
fix_multip
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6417e81cd0 | ||
|
|
44f236e9cd | ||
|
|
002d69b364 |
77
.github/workflows/sdk-ci.yml
vendored
77
.github/workflows/sdk-ci.yml
vendored
@@ -1,4 +1,5 @@
|
||||
name: Raspberry PI Pico Docker SDK CI
|
||||
|
||||
name: Build, test and push Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -14,34 +15,64 @@ env:
|
||||
TEST_TAG: pico_test_sdk
|
||||
|
||||
jobs:
|
||||
sdk_container:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Build SDK
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
load: true
|
||||
tags: ${{ env.TEST_TAG }}
|
||||
- name: Test SDK
|
||||
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
|
||||
- name: Log into Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
|
||||
- name: Set up QEMU (for ARM builds)
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
- name: Extract SDK metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: lukstep/raspberry-pi-pico-sdk
|
||||
- name: Push SDK image
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
uses: docker/build-push-action@v4
|
||||
|
||||
- name: Build Docker image (multi-arch, no push)
|
||||
uses: docker/build-push-action@v6
|
||||
id: build
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
push: false
|
||||
load: true # Allows testing the image locally
|
||||
tags: ${{ env.TEST_TAG }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Run Tests (from built image)
|
||||
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
|
||||
|
||||
push-image:
|
||||
needs: build-and-test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Build and Push Docker image (multi-arch)
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: lukstep/raspberry-pi-pico-sdk:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
@@ -23,7 +23,7 @@ RUN apt-get update -y && \
|
||||
|
||||
# Raspberry Pi Pico SDK
|
||||
ARG SDK_PATH=/usr/local/picosdk
|
||||
RUN git clone --depth 1 --branch 2.1.0 https://github.com/raspberrypi/pico-sdk $SDK_PATH && \
|
||||
RUN git clone --depth 1 --branch 2.1.1 https://github.com/raspberrypi/pico-sdk $SDK_PATH && \
|
||||
cd $SDK_PATH && \
|
||||
git submodule update --init
|
||||
|
||||
@@ -31,14 +31,14 @@ ENV PICO_SDK_PATH=$SDK_PATH
|
||||
|
||||
# FreeRTOS
|
||||
ARG FREERTOS_PATH=/usr/local/freertos
|
||||
RUN git clone --depth 1 --branch V11.0.1 https://github.com/FreeRTOS/FreeRTOS-Kernel $FREERTOS_PATH && \
|
||||
RUN git clone --depth 1 --branch V11.2.0 https://github.com/FreeRTOS/FreeRTOS-Kernel $FREERTOS_PATH && \
|
||||
cd $FREERTOS_PATH && \
|
||||
git submodule update --init --recursive
|
||||
|
||||
ENV FREERTOS_KERNEL_PATH=$FREERTOS_PATH
|
||||
|
||||
# Picotool installation
|
||||
RUN git clone --depth 1 --branch 2.1.0 https://github.com/raspberrypi/picotool.git /home/picotool && \
|
||||
RUN git clone --depth 1 --branch 2.1.1 https://github.com/raspberrypi/picotool.git /home/picotool && \
|
||||
cd /home/picotool && \
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
|
||||
@@ -9,7 +9,7 @@ if [[ -z $1 ]]; then
|
||||
echo "Please provide an SDK image you want to test"
|
||||
fi
|
||||
|
||||
declare -a boards=("pico" "pico_w" "pico2" "pico2_riscv")
|
||||
declare -a boards=("pico" "pico_w" "pico2" "pico2_riscv" "pico2_w" "pico2_w_riscv")
|
||||
|
||||
|
||||
docker run -d -it --name pico-sdk --mount type=bind,source="${PWD}"/test_poject,target=/home/dev "$1"
|
||||
@@ -20,6 +20,8 @@ do
|
||||
docker exec pico-sdk /bin/bash -c "rm -rf /home/dev/build"
|
||||
if [[ $board = pico2_riscv ]] ; then
|
||||
docker exec -i pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=pico2 -DPICO_PLATFORM=rp2350-riscv && make -j4"
|
||||
elif [[ $board = pico2_w_riscv ]] ; then
|
||||
docker exec -i pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=pico2_w -DPICO_PLATFORM=rp2350-riscv && make -j4"
|
||||
else
|
||||
docker exec -i pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=${board} && make -j4"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user