From 1a310ee866ed7326f054fcede6b85f3ffcf2d394 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 6 Sep 2024 09:36:35 +0200 Subject: [PATCH] test(appimage): move tests to docker --- .github/workflows/appimage.yml | 35 +++++++++------------------------ AppImageBuilder.test.Dockerfile | 30 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 AppImageBuilder.test.Dockerfile diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 07fa79d9..37918376 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -91,32 +91,15 @@ jobs: recipe: "${{ matrix.base.recipe }}" - name: Test AppImage - shell: bash - run: | - set -eu - - handle_failure() { - return_code="${1}" - codename="${{ matrix.base.codename }}" - case "${codename}" in - noble|trixie|bookworm) echo "Ignoring failure ${return_code} for ${codename} which is currently known to cause a segmentation fault" ;; - *) return "${return_code}" ;; - esac - } - - find . -maxdepth 1 -type f -name '*.AppImage' | while read -r file; do - echo "${file}" - sudo chmod +x "${file}" - rm -rf squashfs-root/ - if [ '${{ matrix.target.platform }}' != 'linux/amd64' ]; then - emulator="qemu-${APPIMAGE_ARCH}-static" - fi - ${emulator-} "${file}" --appimage-extract >/dev/null - ( - cd squashfs-root/runtime/compat - ${emulator-} ../../AppRun dependency-check || handle_failure "$?" "${file}" - ) - done + uses: docker/build-push-action@v5 + with: + file: AppImageBuild.test.Dockerfile + platforms: ${{ matrix.target.platform }} + outputs: test + build-args: | + BASE_OS=${{ matrix.base.os }} + BASE_CODENAME=${{ matrix.base.codename }} + APPIMAGE_APT_DISTRO - name: Upload artifacts uses: actions/upload-artifact@v4 diff --git a/AppImageBuilder.test.Dockerfile b/AppImageBuilder.test.Dockerfile new file mode 100644 index 00000000..5ba739ac --- /dev/null +++ b/AppImageBuilder.test.Dockerfile @@ -0,0 +1,30 @@ +# syntax=docker/dockerfile:1 +ARG BASE_OS=ubuntu +ARG BASE_CODENAME=noble +FROM $BASE_OS:$BASE_CODENAME +ARG APPIMAGE_APT_DISTRO +WORKDIR /tmp +COPY *.AppImage /opt/ +RUN </dev/null + ( + cd squashfs-root/runtime/compat + ../../AppRun dependency-check || handle_failure "$?" "${file}" + ) + done +EOR