Skip to content

Commit 1186f6f

Browse files
[ci] Add test for installation in multiple architectures (#597)
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. Additionally the updated docs are published only if this test is passed.
2 parents 31aa32b + 5ac30b1 commit 1186f6f

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
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: 26 additions & 1 deletion
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'
@@ -121,7 +146,7 @@ jobs:
121146

122147
publish-docs:
123148
name: Publish documentation website to GitHub pages
124-
needs: ["nox", "build"]
149+
needs: ["nox", "test-installation"]
125150
if: github.event_name == 'push'
126151
runs-on: ubuntu-20.04
127152
permissions:

0 commit comments

Comments
 (0)