Skip to content

Commit

Permalink
CI/CD: Pico SDK version checkout moved to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pstolarz committed Dec 22, 2024
1 parent 104769d commit 4179b25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/picosdk-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ENV PICO_SDK_PATH=/pico-sdk
RUN cd / && \
git clone https://github.com/raspberrypi/pico-sdk && \
cd pico-sdk && \
git checkout 2.0.0 && \
git submodule update --init --recursive

RUN apt-get update && \
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/picosdk-builds.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Pico SDK builds
env:
SDK_VER: 2.1.0
on:
push:
branches:
Expand All @@ -15,11 +17,10 @@ jobs:
runs-on: ubuntu-latest
container: ghcr.io/pstolarz/picosdk-ci
steps:
- name: Pico SDK recent versions info
run: |
cd /pico-sdk
git fetch || true
git tag | sort | awk "/$(git describe --tags)/ {f=1} f==1 {print}"
- name: Set SDK version
run: cd /pico-sdk && git fetch && git checkout ${SDK_VER} && git submodule update --init --recursive
- name: SDK recent versions info
run: cd /pico-sdk && 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 @@ -35,13 +36,15 @@ jobs:
-DCONFIG_ITERATION_RETRIES=1"
steps:
- uses: actions/checkout@v4
- name: Set SDK version
run: cd /pico-sdk && git fetch && git checkout ${SDK_VER} && git submodule update --init --recursive
- name: Build
run: |
repo_dir=$(pwd)
rm -rf /tmp/picosdk-build && mkdir /tmp/picosdk-build && cd /tmp/picosdk-build
ln -s ${repo_dir} OneWireNg
ln -s ${repo_dir}/examples/pico-sdk/${{ matrix.example }}/${{ matrix.example }}.cpp ${{ matrix.example }}.cpp
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
ln -s ${repo_dir}/examples/pico-sdk/${{matrix.example}}/${{matrix.example}}.cpp ${{matrix.example}}.cpp
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"

0 comments on commit 4179b25

Please sign in to comment.