diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7c596ef5..d6dc3ab94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,6 @@ name: Build on: push: - branches: - - 'master' pull_request: workflow_dispatch: diff --git a/ci/build.sh b/ci/build.sh index 942c1a064..643685c44 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -89,35 +89,33 @@ docker run --rm \ # test appimagetool-"$ARCH".AppImage # note: if we're in a CI system, we allow the use of FUSE in the container, to make sure that this functionality works as intended # outside CI environments, we use APPIMAGE_EXTRACT_AND_RUN instead, which is safer, but gives less meaningful results +docker_test_opts=("${common_docker_opts[@]}") + # note: FUSE and QEMU don't like each other, so if we're running in emulated mode, we can't run these tests -# therefore, by default, on ARM, these tests are not run -if [[ "$ARCH" != "arm"* ]] && [[ "$ARCH" != "aarch"* ]]; then - docker_test_opts=("${common_docker_opts[@]}") - - if [[ "$CI" != "" ]]; then - echo "Warning: assuming this is running in a CI environment, allowing the use of FUSE in the container" - docker_test_opts+=( - "--device" "/dev/fuse:mrw" - "--cap-add" "SYS_ADMIN" - "--security-opt" "apparmor:unconfined" - ) - else - echo "Note: this is not a CI environment, using APPIMAGE_EXTRACT_AND_RUN and patching out magic bytes" - docker_test_opts+=( - "-e" "APPIMAGE_EXTRACT_AND_RUN=1" - "-e" "PATCH_OUT_MAGIC_BYTES=1" - ) - fi - - # to make fuse happy, we need to use a "real" user - # as we don't want to use root, we use the user "build" we created in AppImageBuild - docker run --rm \ - --user build \ - "${docker_test_opts[@]}" \ - "$docker_image" \ - /bin/bash -xc "cd /out && bash /ws/ci/test-appimage.sh ./appimagetool-\"$ARCH\".AppImage" +# therefore, by default, on ARM, these tests are not run with FUSE +if [[ "$CI" != "" ]] && [[ "$ARCH" != "arm"* ]] && [[ "$ARCH" != "aarch"* ]]; then + echo "Warning: assuming this is running in a CI environment, allowing the use of FUSE in the container" + docker_test_opts+=( + "--device" "/dev/fuse:mrw" + "--cap-add" "SYS_ADMIN" + "--security-opt" "apparmor:unconfined" + ) +else + echo "Note: this is not a CI environment (or an ARM build), using APPIMAGE_EXTRACT_AND_RUN and patching out magic bytes" + docker_test_opts+=( + "-e" "APPIMAGE_EXTRACT_AND_RUN=1" + "-e" "PATCH_OUT_MAGIC_BYTES=1" + ) fi +# to make fuse happy, we need to use a "real" user +# as we don't want to use root, we use the user "build" we created in AppImageBuild +docker run --rm \ + --user build \ + "${docker_test_opts[@]}" \ + "$docker_image" \ + /bin/bash -xc "cd /out && bash /ws/ci/test-appimage.sh ./appimagetool-\"$ARCH\".AppImage" + # remove binaries from output directory ls -al out/ rm out/appimagetool