Add library verification step (#3436)
Summary: This is pretty dumb but hopefully good enough to prevent accidental regressions. We simply check if there are "enough" `libevent_core.so`s in the bundle. This is obviously not future-proof but it's super cheap to run and if it causes problems at some point, we can always remove it. Apologies for the formatting spam. Didn't notice until I submitted this that my editor got a little passive-aggressive. Pull Request resolved: https://github.com/facebook/flipper/pull/3436 Test Plan: CI here. Reviewed By: lblasa Differential Revision: D34210743 Pulled By: passy fbshipit-source-id: a57c397e39456fae33af9f3ceed08b6944eac79e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
05b1575175
commit
b8fdb14dfb
53
.github/workflows/android-sample.yml
vendored
53
.github/workflows/android-sample.yml
vendored
@@ -1,33 +1,36 @@
|
||||
name: Build Sample App
|
||||
name: Build Android Sample App
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: set up JDK
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Compute build cache
|
||||
run: ./scripts/checksum-android.sh checksum-android.txt
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches/modules-*
|
||||
~/.gradle/caches/jars-*
|
||||
~/.gradle/caches/build-cache-*
|
||||
key: gradle-${{ hashFiles('checksum-android.txt') }}
|
||||
- name: Build sample apps with Gradle
|
||||
run: ./gradlew :sample:assembleDebug :tutorial:assembleDebug
|
||||
- name: Build remaining artifacts with Gradle
|
||||
run: ./gradlew assembleDebug
|
||||
- name: upload artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: sample-app.apk
|
||||
path: android/sample/build/outputs/apk/debug/sample-debug.apk
|
||||
- uses: actions/checkout@v2
|
||||
- name: set up JDK
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Compute build cache
|
||||
run: ./scripts/checksum-android.sh checksum-android.txt
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches/modules-*
|
||||
~/.gradle/caches/jars-*
|
||||
~/.gradle/caches/build-cache-*
|
||||
key: gradle-${{ hashFiles('checksum-android.txt') }}
|
||||
- name: Build debug artifact
|
||||
run: ./gradlew :android:assembleDebug
|
||||
- name: Verify libraries in artifact
|
||||
run: scripts/verify-android-libraries.sh
|
||||
- name: Build sample apps with Gradle
|
||||
run: ./gradlew :sample:assembleDebug :tutorial:assembleDebug
|
||||
- name: Build remaining artifacts with Gradle
|
||||
run: ./gradlew assembleDebug
|
||||
- name: upload artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: sample-app.apk
|
||||
path: android/sample/build/outputs/apk/debug/sample-debug.apk
|
||||
|
||||
17
scripts/verify-android-libraries.sh
Executable file
17
scripts/verify-android-libraries.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||
NUM=$(unzip -l "$BASEDIR"/android/build/outputs/aar/android-debug.aar | grep -c libevent_core)
|
||||
|
||||
if (( NUM >= 4 )); then
|
||||
echo "Found $NUM instances of libevent_core. Looks good."
|
||||
exit 0
|
||||
else
|
||||
unzip -l "$BASEDIR"/android/build/outputs/aar/android-debug.aar | grep libevent_core
|
||||
echo "Expected 4 but found $NUM libevent_core.so files. Expecting one for each architecture. See #3395 for details."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user