Skip to content

Commit ecea080

Browse files
committed
Add Github CI configuration
1 parent 17a8f90 commit ecea080

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

.github/workflows/sdk-ci.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Raspberry PI Pico Docker SDK CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
release:
11+
types: [published]
12+
13+
env:
14+
TEST_TAG: pico_test_sdk
15+
16+
jobs:
17+
sdk_container:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- name: Build SDK
23+
uses: docker/build-push-action@v4
24+
with:
25+
context: .
26+
load: true
27+
tags: ${{ env.TEST_TAG }}
28+
- name: Test SDK
29+
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
30+
- name: Log into Docker Hub
31+
uses: docker/login-action@v2
32+
with:
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
35+
- name: Extract SDK metadata
36+
id: meta
37+
uses: docker/metadata-action@v4
38+
with:
39+
images: lukstep/raspberry-pi-pico-sdk
40+
- name: Push SDK image
41+
if: github.event_name == 'release' && github.event.action == 'published'
42+
uses: docker/build-push-action@v4
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Raspberry PI Pico Docker SDK CI](https://github.com/lukstep/raspberry-pi-pico-docker-sdk/actions/workflows/sdk-ci.yml/badge.svg?branch=main)](https://github.com/lukstep/raspberry-pi-pico-docker-sdk/actions/workflows/sdk-ci.yml)
2+
13
# Raspberry Pi Pico Docker SDK
24

35
Lightweight Raspberry Pi Pico C++ SDK container.

test_sdk.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
docker build . --tag lukstep/raspberry-pi-pico-sdk:latest
2-
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD}/test_poject,target=/home/dev lukstep/raspberry-pi-pico-sdk:latest
1+
if [[ -z $1 ]]; then
2+
echo "Please provide an SDK image you want to test"
3+
fi
4+
5+
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD}/test_poject,target=/home/dev $1
36
docker exec pico-sdk /bin/sh -c "cd /home/dev && mkdir build && cd build && cmake .. && make -j4"
47
docker exec pico-sdk /bin/sh -c "picotool"
58
docker container kill pico-sdk

0 commit comments

Comments
 (0)