feat: adapt to Android 15 linker symbols #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- "**.gradle" | |
- "**.py" | |
- ".github/**" | |
- "emulator-testapp/**" | |
- "library/**" | |
- "fakelinker-test/**" | |
- "Stub/**" | |
tags: | |
- "v*" | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
env: | |
BROWSER_TEST_MAX_DURATION: 600 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
cache: gradle | |
- name: Install store file | |
run: echo ${{ secrets.STORE_FILE }} | base64 -d > fake.jks | |
- name: Install build configuration | |
run: | | |
echo storeFile=`pwd`/fake.jks > local.properties | |
echo storePassword=${{ secrets.STORE_PASSWORD }} >> local.properties | |
echo keyAlias=${{ secrets.KEY_ALIAS }} >> local.properties | |
echo keyPassword=${{ secrets.KEY_PASSWORD }} >> local.properties | |
echo logLevel=3 >> local.properties | |
echo targetSdk=34 >> local.properties | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew -PmergeBuild=true -PemulatorBuild=false fakelinker-test:assembleDebug fakelinker-test:assembleDebugAndroidTest library:assembleDebug library:assembleRelease | |
- name: Copy output | |
run: | | |
mkdir -p out/test_binary out/test_apk | |
mv fakelinker-test/src/main/cpp/build/Debug out/test_binary | |
mv fakelinker-test/build/outputs/apk/debug/fakelinker-test-debug.apk out/test_apk/fakelinker-test-debug.apk | |
mv fakelinker-test/build/outputs/apk/androidTest/debug/fakelinker-test-debug-androidTest.apk out/test_apk/fakelinker-androidtest-debug-testsuite.apk | |
mv library/build/outputs/aar/library-debug.aar out/fakelinker-lib-debug.aar | |
mv library/build/outputs/aar/library-release.aar out/fakelinker-lib-release.aar | |
- name: Build emulator version with Gradle | |
run: | | |
rm -rf library/build/intermediates/merged_native_libs | |
./gradlew -PmergeBuild=true -PemulatorBuild=true emulator-testapp:assembleDebug library:assembleDebug library:assembleRelease | |
- name: Copy emulator version output | |
run: | | |
mv emulator-testapp/build/outputs/apk/debug/emulator-testapp-debug.apk out/test_apk/fakelinker-emulator-test-debug.apk | |
mv library/build/outputs/aar/library-debug.aar out/fakelinker-emulator-lib-debug.aar | |
mv library/build/outputs/aar/library-release.aar out/fakelinker-emulator-lib-release.aar | |
- name: Build 32-bit test app | |
run: | | |
rm -rf library/build/intermediates/merged_native_libs | |
rm -rf fakelinker-test/build/intermediates/merged_native_libs | |
echo "abis=armeabi-v7a,x86" >> local.properties | |
./gradlew fakelinker-test:assembleDebug | |
- name: Copy 32-bit test app | |
run: | | |
mv fakelinker-test/build/outputs/apk/debug/fakelinker-test-debug.apk out/test_apk/fakelinker-test-32bit-debug.apk | |
- name: Uninstall store file | |
run: rm -f fake.jks | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.sha }}-build | |
# A file, directory or wildcard pattern that describes what to upload | |
path: out | |
test_apk: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
pip install requests | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.sha }}-build | |
path: ./artifacts | |
- name: Run BrowerStack 64bit Test | |
run: | | |
python ./browser_stack_test.py test \ | |
--apk artifacts/test_apk/fakelinker-test-debug.apk \ | |
--test-suite artifacts/test_apk/fakelinker-androidtest-debug-testsuite.apk \ | |
--apk-custom-id FakelinkerTestApp \ | |
--test-suite-custom-id FakelinkerTestSuite \ | |
--build-last-failed \ | |
--all-api \ | |
--device-log | |
env: | |
BROWSER_STACK_KEY: ${{ secrets.BROWSER_STACK_KEY }} | |
- name: Run BrowerStack 32bit Test | |
run: | | |
python ./browser_stack_test.py test \ | |
--apk artifacts/test_apk/fakelinker-test-32bit-debug.apk \ | |
--test-suite artifacts/test_apk/fakelinker-androidtest-debug-testsuite.apk \ | |
--apk-custom-id FakelinkerTestApp \ | |
--test-suite-custom-id FakelinkerTestSuite \ | |
--build-last-failed \ | |
--all-api \ | |
--device-log \ | |
--is-32bit | |
env: | |
BROWSER_STACK_KEY: ${{ secrets.BROWSER_STACK_KEY }} |