Skip to content

Force cold-boot emulator and rely on file-path installs #191

Force cold-boot emulator and rely on file-path installs

Force cold-boot emulator and rely on file-path installs #191

---
name: Test Android build scripts
'on':
pull_request:
paths:
- 'scripts/**'
- 'BUILDING.md'
push:
branches:
- master
paths-ignore:
- '**/*.md'
jobs:
build-android:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- name: Install System Dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y xvfb libxrender1 libxtst6 libxi6 xmlstarlet
- name: Free disk space (action)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Free disk space for emulator
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Increase swap space for emulator
run: |
sudo swapoff -a
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h
- name: Configure emulator timeouts
run: |
echo "EMULATOR_BOOT_TIMEOUT_SECONDS=1200" >> "$GITHUB_ENV"
echo "PACKAGE_SERVICE_TIMEOUT_SECONDS=1200" >> "$GITHUB_ENV"
echo "FRAMEWORK_READY_PRIMARY_TIMEOUT_SECONDS=300" >> "$GITHUB_ENV"
echo "FRAMEWORK_READY_RESTART_TIMEOUT_SECONDS=240" >> "$GITHUB_ENV"
echo "EMULATOR_POST_BOOT_GRACE_SECONDS=30" >> "$GITHUB_ENV"
echo "UI_TEST_TIMEOUT_SECONDS=1200" >> "$GITHUB_ENV"
- name: Setup workspace
run: ./scripts/setup-workspace.sh -q -DskipTests
- name: Build Android port
run: ./scripts/build-android-port.sh -q -DskipTests
- name: Build Hello Codename One Android app
run: ./scripts/build-android-app.sh -q -DskipTests
env:
AVD_CACHE_ROOT: ${{ github.workspace }}/.android-avd
- name: Upload UI test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: hello-codenameone-ui-test-artifacts
path: ${{ env.CN1_UI_TEST_ARTIFACT_DIR }}
if-no-files-found: warn