Skip to content

Commit baab754

Browse files
committed
Update test runner
1 parent 9586546 commit baab754

File tree

1 file changed

+41
-53
lines changed

1 file changed

+41
-53
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -35,60 +35,48 @@ jobs:
3535
ANDROID_API: ${{ matrix.ANDROID_API }}
3636
ANDROID_ARCH: ${{ matrix.ANDROID_ARCH }}
3737
steps:
38-
- name: Checkout tools repo
39-
uses: actions/checkout@v5
40-
with:
41-
repository: amrsa1/Android-Emulator-image
42-
path: Android-Emulator-image
43-
- name: Install Docker
38+
- name: "Launch emulator"
39+
timeout-minutes: 10
40+
run: |
41+
# Install AVD files
42+
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "system-images;android-${ANDROID_API};default;${ANDROID_ARCH}"
43+
# Create emulator
44+
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -f -n test -d "Nexus 10" -k "system-images;android-${ANDROID_API};default;${ANDROID_ARCH}" --force
45+
echo "y" | $ANDROID_HOME/emulator/emulator -list-avds
46+
echo "Starting emulator"
47+
48+
# Start emulator in background
49+
nohup $ANDROID_HOME/emulator/emulator -avd test -no-snapshot -no-window -no-audio -no-boot-anim -no-accel -no-metrics &
50+
# Fixed quoting around "\r"
51+
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d "\r") ]]; do sleep 1; done; input keyevent 82'
52+
$ANDROID_HOME/platform-tools/adb devices
53+
echo "Emulator started"
54+
55+
- name: "Check Emulator"
56+
run: |
57+
$ANDROID_HOME/platform-tools/adb shell 'echo Hello Android!'
58+
59+
- name: "Install Skip (macOS)"
4460
if: ${{ startsWith(matrix.os, 'macos-') }}
45-
run: brew install docker
46-
- name: "Launch emulator (Docker)"
47-
timeout-minutes: 20
48-
working-directory: Android-Emulator-image
4961
run: |
50-
docker build \
51-
--build-arg ARCH=x86_64 \
52-
--build-arg TARGET=google_apis_playstore\
53-
--build-arg API_LEVEL=31 \
54-
--build-arg BUILD_TOOLS=31.0.0 \
55-
--build-arg EMULATOR_DEVICE="Nexus 6" \
56-
--build-arg EMULATOR_NAME=nexus \
57-
-t my-android-image .
58-
docker exec --privileged -it -e EMULATOR_TIMEOUT=300 my-android-image bash -c "./start_emu_headless.sh"
59-
adb shell 'echo Hello World'
62+
brew install skiptools/skip/skip
63+
skip android sdk install
6064
61-
#- name: "Launch emulator"
62-
# timeout-minutes: 10
63-
# run: |
64-
# # Install AVD files
65-
# echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "system-images;android-${ANDROID_API};default;${ANDROID_ARCH}"
66-
# # Create emulator
67-
# echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -f -n test -d "Nexus 10" -k "system-images;android-${ANDROID_API};default;${ANDROID_ARCH}" --force
68-
# echo "y" | $ANDROID_HOME/emulator/emulator -list-avds
69-
# echo "Starting emulator"
70-
#
71-
# # Start emulator in background
72-
# nohup $ANDROID_HOME/emulator/emulator -avd test -no-snapshot -no-window -no-audio -no-boot-anim -no-accel -no-metrics &
73-
# # Fixed quoting around "\r"
74-
# $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d "\r") ]]; do sleep 1; done; input keyevent 82'
75-
# $ANDROID_HOME/platform-tools/adb devices
76-
# echo "Emulator started"
77-
#
78-
#- name: "Check Emulator"
79-
# run: |
80-
# $ANDROID_HOME/platform-tools/adb shell 'echo Hello Android!'
81-
#
82-
#- name: "Install Skip"
83-
# run: |
84-
# brew install skiptools/skip/skip
85-
# skip android sdk install
86-
#
87-
#- name: "Test Swift Package"
88-
# run: |
89-
# mkdir PackageDemo
90-
# cd PackageDemo
91-
# swift package init
92-
# swift test
93-
# skip android test
65+
- name: Install Skip (Ubuntu)
66+
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
67+
run: |
68+
mkdir -p ~/bin/skiptools
69+
cd ~/bin/skiptools
70+
curl -fsSLO https://github.com/skiptools/skip/releases/latest/download/skip-linux.zip
71+
unzip skip-linux.zip
72+
echo "PATH=${PWD}/skip.artifactbundle/$(uname -m)-swift-linux-musl:${PATH}" >> $GITHUB_ENV
73+
cd -
74+
75+
- name: "Test Swift Package"
76+
run: |
77+
mkdir PackageDemo
78+
cd PackageDemo
79+
swift package init
80+
swift test
81+
skip android test
9482

0 commit comments

Comments
 (0)