diff --git a/.github/workflows/emulator.yml b/.github/workflows/emulator.yml index b4a5d948..26e61bad 100644 --- a/.github/workflows/emulator.yml +++ b/.github/workflows/emulator.yml @@ -41,10 +41,8 @@ jobs: - name: Build zipball, channel tarball and flake to inject run: | rm -rf n-o-d - mkdir -p n-o-d/unpacked - git -C . archive --format=tar --prefix n-o-d/ HEAD > n-o-d/archive.tar - tar --strip-components=1 -xf n-o-d/archive.tar -C n-o-d/unpacked - gzip n-o-d/archive.tar + mkdir -p n-o-d + git -C . archive --format=tar.gz --prefix n-o-d/ HEAD > n-o-d/archive.tar.gz nix run '.#deploy' -- file:///data/local/tmp/n-o-d/archive.tar.gz n-o-d/ - name: Configure AVD cache @@ -77,6 +75,7 @@ jobs: script: > adb shell 'rm -rf /data/local/tmp/n-o-d' && adb push n-o-d /data/local/tmp/ && + adb shell 'cd /data/local/tmp/n-o-d && tar xzf archive.tar.gz && mv n-o-d unpacked' && cd tests/emulator && adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService && nix run 'github:t184256/droidctl' -- run ${{ matrix.way }}.py diff --git a/nix-on-droid/nix-on-droid.sh b/nix-on-droid/nix-on-droid.sh index 64ea9cc1..6b8bd2c5 100644 --- a/nix-on-droid/nix-on-droid.sh +++ b/nix-on-droid/nix-on-droid.sh @@ -87,15 +87,7 @@ function doHelp() { } function doOnDeviceTest() { - # This is for maintainer convenience only, see tests/on-device/.run.sh - - # /data/local/tmp/n-o-d/unpacked is available in fakedroid environment - if [[ -d "/data/local/tmp/n-o-d/unpacked" ]]; then - export NIX_PATH="nix-on-droid=/data/local/tmp/n-o-d/unpacked:$NIX_PATH" - else - nix-channel --update nix-on-droid - fi - + nix-channel --update nix-on-droid exec "$(nix-instantiate --eval --expr \ "")" "$@" } diff --git a/scripts/deploy.sh b/scripts/deploy.sh index fedb51fb..2b4330aa 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -45,11 +45,14 @@ else { echo "unsupported url $PUBLIC_URL" >&2; exit 1; } export NIX_ON_DROID_CHANNEL_URL="$PUBLIC_URL" fi -if [[ "$PUBLIC_URL" =~ ^file:///(.*) ]]; then - export NIX_ON_DROID_FLAKE_URL="/${BASH_REMATCH[1]}" +# special case for local / CI testing +if [[ "$PUBLIC_URL" =~ ^file:///(.*)/archive.tar.gz ]]; then + export NIX_ON_DROID_FLAKE_URL="/${BASH_REMATCH[1]}/unpacked" else export NIX_ON_DROID_FLAKE_URL="$PUBLIC_URL" fi +log "NIX_ON_DROID_CHANNEL_URL=$NIX_ON_DROID_CHANNEL_URL" +log "NIX_ON_DROID_FLAKE_URL=$NIX_ON_DROID_FLAKE_URL" PROOT_HASH_FILE="modules/environment/login/default.nix" diff --git a/tests/fakedroid.sh b/tests/fakedroid.sh index b79c6b76..2f99f526 100644 --- a/tests/fakedroid.sh +++ b/tests/fakedroid.sh @@ -100,12 +100,11 @@ fi rm -rf "$ENV_DIR/data/local/tmp/n-o-d" mkdir -p "$ENV_DIR/data/local/tmp/n-o-d/unpacked" -git -C "$REPO_DIR" archive --format=tar --prefix n-o-d/ HEAD \ - > "$ENV_DIR/data/local/tmp/n-o-d/archive.tar" -tar --strip-components=1 -xf \ - "$ENV_DIR/data/local/tmp/n-o-d/archive.tar" \ +git -C "$REPO_DIR" archive --format=tar.gz --prefix n-o-d/ HEAD \ + > "$ENV_DIR/data/local/tmp/n-o-d/archive.tar.gz" +tar --strip-components=1 -xzf \ + "$ENV_DIR/data/local/tmp/n-o-d/archive.tar.gz" \ -C "$ENV_DIR/data/local/tmp/n-o-d/unpacked" -gzip "$ENV_DIR/data/local/tmp/n-o-d/archive.tar" # The 'first boot' proot invocation: