Skip to content

Fix #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix #16

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 44 additions & 18 deletions .github/workflows/sdk-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Raspberry PI Pico Docker SDK CI

name: Build, test and push Docker image

on:
push:
Expand All @@ -14,39 +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: Set up QEMU

- 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: Build SDK

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build Docker image (multi-arch, no push)
uses: docker/build-push-action@v6
id: build
with:
context: .
load: true
platforms: linux/amd64
push: false
load: true # Allows testing the image locally
tags: ${{ env.TEST_TAG }}
- name: Test SDK
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run Tests (from built image)
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
- name: Log into Docker Hub

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: 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'

- name: Build and Push Docker image (multi-arch)
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
tags: lukstep/raspberry-pi-pico-sdk:latest
cache-from: type=gha
cache-to: type=gha,mode=max
Loading