Skip to content

Commit

Permalink
CI/CD: Pico SDK workflow refactored - cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
pstolarz committed Dec 30, 2024
1 parent 0e211ca commit 1d48454
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
17 changes: 6 additions & 11 deletions .github/picosdk-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,19 @@ FROM ubuntu:latest
ENV TZ=Europe/Warsaw
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && \
apt-get install -y \
git

ENV PICO_SDK_PATH=/pico-sdk

RUN cd / && \
git clone https://github.com/raspberrypi/pico-sdk && \
cd pico-sdk && \
git submodule update --init --recursive

RUN apt-get update && \
apt-get install -y \
cmake \
g++ \
gcc-arm-none-eabi \
git \
make \
nodejs \
python3 \
sudo
RUN apt-get clean

RUN git clone -- https://github.com/raspberrypi/pico-sdk /pico-sdk && \
cd /pico-sdk && \
git submodule update --init --recursive && \
chmod --recursive a+rw .
29 changes: 18 additions & 11 deletions .github/workflows/picosdk-builds.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Pico SDK builds
env:
SDK_VER: 2.1.0
PICO_SDK_PATH: /pico-sdk
on:
push:
branches:
Expand All @@ -19,11 +20,11 @@ jobs:
steps:
- uses: actions/cache@v4
with:
path: /pico-sdk
key: pico_sdk_cache
- name: Set SDK version
path: ${{ env.PICO_SDK_PATH }}
key: sdk-${{ env.SDK_VER }}
- name: Pico SDK checkout
run: |
cd /pico-sdk
cd ${PICO_SDK_PATH}
git fetch || true
git checkout -f ${SDK_VER}
git submodule update -f --init --recursive
Expand All @@ -34,10 +35,13 @@ jobs:
steps:
- uses: actions/cache@v4
with:
path: /pico-sdk
key: pico_sdk_cache
- name: SDK recent versions info
run: cd /pico-sdk && git tag | sort | awk "/$(git describe --tags)/ {f=1} f==1 {print}"
path: ${{ env.PICO_SDK_PATH }}
key: sdk-${{ env.SDK_VER }}
- name: Pico SDK recent versions info
run: |
cd ${PICO_SDK_PATH}
git fetch || true
git tag | sort | awk "/$(git describe --tags)/ {f=1} f==1 {print}"
picosdk_build:
runs-on: ubuntu-latest
container: ghcr.io/pstolarz/picosdk-ci
Expand All @@ -56,8 +60,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: /pico-sdk
key: pico_sdk_cache
path: ${{ env.PICO_SDK_PATH }}
key: sdk-${{ env.SDK_VER }}
- name: Build
run: |
repo_dir=$(pwd)
Expand All @@ -67,4 +71,7 @@ jobs:
ln -s ${repo_dir}/examples/pico-sdk/${{ matrix.example }}/CMakeLists.txt CMakeLists.txt
ln -s ${repo_dir}/examples/pico-sdk/${{ matrix.example }}/pico_sdk_import.cmake pico_sdk_import.cmake
mkdir build && cd build
sudo bash -c "PICO_SDK_PATH=/pico-sdk CXXFLAGS=\"${BUILD_FLAGS}\" CFLAGS=\"${BUILD_FLAGS}\" cmake .. && make"
export CXXFLAGS="${BUILD_FLAGS}"
export CFLAGS="${BUILD_FLAGS}"
cmake ..
make

0 comments on commit 1d48454

Please sign in to comment.