Skip to content

Commit

Permalink
test(appimage): move tests to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
git-developer committed Sep 6, 2024
1 parent d13807a commit 1a310ee
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 26 deletions.
35 changes: 9 additions & 26 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions AppImageBuilder.test.Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <<EOR
set -eu

handle_failure() {
return_code="${1}"
codename="${APPIMAGE_APT_DISTRO}"
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 /opt/ -maxdepth 1 -type f -name '*.AppImage' | while read -r file; do
echo "${file}"
chmod +x "${file}"
rm -rf squashfs-root/
"${file}" --appimage-extract >/dev/null
(
cd squashfs-root/runtime/compat
../../AppRun dependency-check || handle_failure "$?" "${file}"
)
done
EOR

0 comments on commit 1a310ee

Please sign in to comment.