Compare commits

...

3 Commits

Author SHA1 Message Date
Jorijn Schrijvershof
2a8c5dfdd9 ci: test docker builds on amd64, arm64, and armv7 in PRs 2026-01-13 07:06:03 +01:00
Jorijn Schrijvershof
0fc6ddfe3b build(docker): fix architecture support by adding UV_LIBC for ARM variants 2026-01-13 06:55:58 +01:00
Jorijn Schrijvershof
5efb81baf0 ci: test every architecture when making a change to the docker build 2026-01-13 06:51:40 +01:00
2 changed files with 23 additions and 6 deletions

View File

@@ -250,27 +250,41 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
tag_suffix: amd64
- platform: linux/arm64
tag_suffix: arm64
- platform: linux/arm/v7
tag_suffix: armv7
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Build image (PR)
- name: Build image (PR - ${{ matrix.platform }})
id: build-pr
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
platforms: linux/amd64
platforms: ${{ matrix.platform }}
load: true
push: false
tags: meshcore-stats:pr-${{ github.event.pull_request.number }}
tags: meshcore-stats:pr-${{ github.event.pull_request.number }}-${{ matrix.tag_suffix }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke test (PR)
- name: Smoke test (PR - ${{ matrix.platform }})
run: |
docker run --rm meshcore-stats:pr-${{ github.event.pull_request.number }} \
docker run --rm --platform ${{ matrix.platform }} \
meshcore-stats:pr-${{ github.event.pull_request.number }}-${{ matrix.tag_suffix }} \
python -c "from meshmon.db import init_db; from meshmon.env import get_config; print('Smoke test passed')"

View File

@@ -58,16 +58,19 @@ RUN set -ex; \
if [ "$TARGETARCH" = "amd64" ]; then \
UV_ARCH="x86_64"; \
UV_SHA256="$UV_SHA256_AMD64"; \
UV_LIBC="gnu"; \
elif [ "$TARGETARCH" = "arm64" ]; then \
UV_ARCH="aarch64"; \
UV_SHA256="$UV_SHA256_ARM64"; \
UV_LIBC="gnu"; \
elif [ "$TARGETARCH" = "arm" ] && [ "$TARGETVARIANT" = "v7" ]; then \
UV_ARCH="armv7"; \
UV_SHA256="$UV_SHA256_ARMV7"; \
UV_LIBC="gnueabihf"; \
else \
echo "Unsupported architecture: $TARGETARCH${TARGETVARIANT:+/$TARGETVARIANT}" && exit 1; \
fi; \
curl -fsSL "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-${UV_ARCH}-unknown-linux-gnu.tar.gz" \
curl -fsSL "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-${UV_ARCH}-unknown-linux-${UV_LIBC}.tar.gz" \
-o /tmp/uv.tar.gz \
&& echo "${UV_SHA256} /tmp/uv.tar.gz" | sha256sum -c - \
&& tar -xzf /tmp/uv.tar.gz -C /usr/local/bin --strip-components=1 --wildcards "*/uv" \