Skip to content

Commit 6417e81

Browse files
committed
Fix
1 parent 44f236e commit 6417e81

File tree

1 file changed

+44
-18
lines changed

1 file changed

+44
-18
lines changed

.github/workflows/sdk-ci.yml

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Raspberry PI Pico Docker SDK CI
1+
2+
name: Build, test and push Docker image
23

34
on:
45
push:
@@ -14,39 +15,64 @@ env:
1415
TEST_TAG: pico_test_sdk
1516

1617
jobs:
17-
sdk_container:
18+
build-and-test:
1819
runs-on: ubuntu-latest
1920
steps:
20-
- name: Checkout
21+
- name: Checkout code
2122
uses: actions/checkout@v3
22-
- name: Set up QEMU
23+
24+
- name: Set up QEMU (for ARM builds)
2325
uses: docker/setup-qemu-action@v3
26+
2427
- name: Set up Docker Buildx
2528
uses: docker/setup-buildx-action@v3
26-
- name: Build SDK
29+
30+
- name: Login to DockerHub
31+
uses: docker/login-action@v3
32+
with:
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
35+
36+
- name: Build Docker image (multi-arch, no push)
2737
uses: docker/build-push-action@v6
38+
id: build
2839
with:
2940
context: .
30-
load: true
41+
platforms: linux/amd64
42+
push: false
43+
load: true # Allows testing the image locally
3144
tags: ${{ env.TEST_TAG }}
32-
- name: Test SDK
45+
cache-from: type=gha
46+
cache-to: type=gha,mode=max
47+
48+
- name: Run Tests (from built image)
3349
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
34-
- name: Log into Docker Hub
50+
51+
push-image:
52+
needs: build-and-test
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v3
57+
58+
- name: Set up QEMU
59+
uses: docker/setup-qemu-action@v3
60+
61+
- name: Set up Docker Buildx
62+
uses: docker/setup-buildx-action@v3
63+
64+
- name: Login to DockerHub
3565
uses: docker/login-action@v3
3666
with:
3767
username: ${{ github.actor }}
3868
password: ${{ secrets.DOCKER_HUB_TOKEN }}
39-
- name: Extract SDK metadata
40-
id: meta
41-
uses: docker/metadata-action@v4
42-
with:
43-
images: lukstep/raspberry-pi-pico-sdk
44-
- name: Push SDK image
45-
if: github.event_name == 'release' && github.event.action == 'published'
69+
70+
- name: Build and Push Docker image (multi-arch)
4671
uses: docker/build-push-action@v6
4772
with:
4873
context: .
49-
push: true
50-
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
5274
platforms: linux/amd64,linux/arm64
75+
push: true
76+
tags: lukstep/raspberry-pi-pico-sdk:latest
77+
cache-from: type=gha
78+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)