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 7, 2024
1 parent 55a89ce commit 93b530c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 22 deletions.
51 changes: 40 additions & 11 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,6 @@ jobs:
with:
recipe: "${{ matrix.base.recipe }}"

- name: Test AppImage
uses: docker/build-push-action@v5
with:
file: AppImageBuilder.test.Dockerfile
context: .
platforms: ${{ matrix.target.platform }}
build-args: |
BASE_OS=${{ matrix.base.os }}
BASE_CODENAME=${{ matrix.base.codename }}
APPIMAGE_APT_DISTRO
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -110,6 +99,46 @@ jobs:
./*.AppImage.zsync
if-no-files-found: error

test:
runs-on: ubuntu-latest
needs:
- build
strategy:
fail-fast: true
matrix:
target:
- platform: linux/amd64
arch: amd64
- platform: linux/arm64
arch: arm64
base:
- os: ubuntu
codename: focal
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: appimage-*-${{ matrix.target.arch }}
path: appimages
merge-multiple: true

- name: Setup qemu for docker
uses: docker/setup-qemu-action@v3
if: matrix.target.platform != 'linux/amd64'

- name: Setup buildx for docker
uses: docker/setup-buildx-action@v3

- name: Test AppImages
uses: docker/build-push-action@v5
with:
file: AppImageBuilder.test.Dockerfile
context: appimages
platforms: ${{ matrix.target.platform }}
build-args: |
BASE_OS=${{ matrix.base.os }}
BASE_CODENAME=${{ matrix.base.codename }}
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
Expand Down
17 changes: 8 additions & 9 deletions AppImageBuilder.test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
ARG BASE_OS=ubuntu
ARG BASE_CODENAME=noble
FROM $BASE_OS:$BASE_CODENAME
ARG APPIMAGE_APT_DISTRO
WORKDIR /tmp
COPY *.AppImage /opt/
RUN <<EOR
Expand All @@ -19,13 +18,13 @@ RUN <<EOR

handle_failure() {
return_code="${1}"
codename="${APPIMAGE_APT_DISTRO}"
case "${codename}" in
noble|trixie|bookworm)
log "Ignoring failure ${return_code} for ${codename}" \
"which is currently known to cause a segmentation fault" ;;
*) return "${return_code}" ;;
esac
file="${2}"
if echo "${file}" | grep -q -P -- '-(noble|trixie|bookworm)-'; then
log "Ignoring failure ${return_code} for ${file}" \
"which is currently known to cause a segmentation fault"
else
return "${return_code}"
fi
}

main() {
Expand All @@ -40,7 +39,7 @@ RUN <<EOR
"${file}" --appimage-extract >/dev/null
(
cd squashfs-root/runtime/compat
../../AppRun dependency-check || handle_failure "$?"
../../AppRun dependency-check || handle_failure "$?" "${file}"
)
done
}
Expand Down
2 changes: 0 additions & 2 deletions AppImageBuilder.test.Dockerfile.dockerignore

This file was deleted.

0 comments on commit 93b530c

Please sign in to comment.