Skip to content

Commit 3b65d59

Browse files
[ci] Add test for installation in multiple architectures
Users should be able to install the frequenz-sdk package in amd64 and arm64 systems. This commit adds a simple test to the CI to validate this. The aforementioned test builds a multi-platform docker image with the generated wheel package. If the image gets successfully generated, then the test passes. Signed-off-by: Tiyash Basu <[email protected]>
1 parent cac5473 commit 3b65d59

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This dockerfile is used to test the installation of the python package in
2+
# multiple platforms in the CI. It is not used to build the package itself.
3+
4+
FROM --platform=${TARGETPLATFORM} python:3.11-slim
5+
6+
RUN python -m pip install --upgrade --no-cache-dir pip
7+
8+
COPY dist dist
9+
RUN pip install dist/*.whl && \
10+
rm -rf dist

.github/workflows/ci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,31 @@ jobs:
8383
path: dist/
8484
if-no-files-found: error
8585

86+
test-installation:
87+
name: Test package installation in different architectures
88+
needs: ["build"]
89+
runs-on: ubuntu-20.04
90+
steps:
91+
- name: Fetch sources
92+
uses: actions/checkout@v3
93+
- name: Download package
94+
uses: actions/download-artifact@v3
95+
with:
96+
name: dist-packages
97+
path: dist
98+
- name: Set up QEMU
99+
uses: docker/setup-qemu-action@v2
100+
- name: Set up docker-buildx
101+
uses: docker/setup-buildx-action@v2
102+
- name: Test Installation
103+
uses: docker/build-push-action@v4
104+
with:
105+
context: .
106+
file: .github/containers/test-installation/Dockerfile
107+
platforms: linux/amd64,linux/arm64
108+
tags: localhost/test-installation
109+
push: false
110+
86111
test-docs:
87112
name: Test documentation website generation
88113
if: github.event_name != 'push'

0 commit comments

Comments
 (0)