From 2fe0fed431097dec701230c5c923405dc437f0b5 Mon Sep 17 00:00:00 2001 From: Nicolas Kruse Date: Sun, 9 Nov 2025 22:05:52 +0100 Subject: [PATCH] docker build ci updated --- .github/workflows/build_docker_image.yml | 35 +++++++++++++++++-- tools/arm64_test/Dockerfile | 6 ++++ .../Dockerfile | 0 tools/crosscompile.sh | 2 +- 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 tools/arm64_test/Dockerfile rename tools/{build_container => cross_compiler_unix}/Dockerfile (100%) diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml index 23ca452..220d388 100644 --- a/.github/workflows/build_docker_image.yml +++ b/.github/workflows/build_docker_image.yml @@ -8,7 +8,7 @@ permissions: contents: read jobs: - docker-build: + docker-build-cross-compiler: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -28,7 +28,38 @@ jobs: run: echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/cross_compiler_unix:1" >> $GITHUB_ENV - name: Build Docker image - run: docker build -t $IMAGE_NAME ./tools/build_container/ + run: docker build -t $IMAGE_NAME ./tools/cross_compiler_unix/ - name: Push Docker image run: docker push $IMAGE_NAME + + docker-build-arm64: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Set image name + run: echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/arm64_test:1" >> $GITHUB_ENV + + - name: Build & Push Docker image + run: docker buildx build --platform linux/arm64 --push -t $IMAGE_NAME tools/arm64_test/ + diff --git a/tools/arm64_test/Dockerfile b/tools/arm64_test/Dockerfile new file mode 100644 index 0000000..a44b16a --- /dev/null +++ b/tools/arm64_test/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.11-slim + +WORKDIR /home + +RUN apt-get update && apt-get install -y build-essential && \ + pip install setuptools wheel pytest pelfy diff --git a/tools/build_container/Dockerfile b/tools/cross_compiler_unix/Dockerfile similarity index 100% rename from tools/build_container/Dockerfile rename to tools/cross_compiler_unix/Dockerfile diff --git a/tools/crosscompile.sh b/tools/crosscompile.sh index 81b4e96..c50c5a8 100644 --- a/tools/crosscompile.sh +++ b/tools/crosscompile.sh @@ -26,7 +26,7 @@ python3 stencils/generate_stencils.py $SRC gcc-13 $FLAGS -$OPT -c $SRC -o $DEST/stencils_x86_64_$OPT.o # Native i686 -gcc-13 $FLAGS -m32 -$OPT -c $SRC -o $DEST/stencils_i686_$OPT.o +cp $DEST/stencils_x86_$OPT.o $DEST/stencils_i686_$OPT.o # ARM64 linux (aarch64) aarch64-linux-gnu-gcc-13 $FLAGS -$OPT -c $SRC -o $DEST/stencils_aarch64_$OPT.o