Skip to content

Commit

Permalink
Add NDK version to app/build.gradle in Android CI (#1526)
Browse files Browse the repository at this point in the history
* Test with specific NDK version

* Add `ndkVersion` to `build.gradle`

* Fix the script

* Try to fix macOS

* One more fix

* Another fix

* Disable upload coverage on macOS
  • Loading branch information
seladb authored Aug 5, 2024
1 parent 641e36e commit 5140b0e
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,16 @@ jobs:
python3 -m pip install gcovr
gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
- name: Upload Coverage Results
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
if: ${{ matrix.host-arch == matrix.arch }}
with:
files: ./coverage.xml
flags: ${{ matrix.os-version }},unittest
fail_ci_if_error: false
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# - name: Upload Coverage Results
# uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
# if: ${{ matrix.host-arch == matrix.arch }}
# with:
# files: ./coverage.xml
# flags: ${{ matrix.os-version }},unittest
# fail_ci_if_error: false
# verbose: true
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Save Ccache
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down Expand Up @@ -668,7 +668,15 @@ jobs:
- name: Build ToyVpn-PcapPlusPlus
working-directory: ./ToyVpn-PcapPlusPlus
run: |
NDK_VERSION=$(echo "$ANDROID_NDK" | awk -F'/' '{print $NF}')
sed -i.bak "s|abiFilters.*$|abiFilters '${{ matrix.target }}'|g" app/build.gradle
if [[ "${{ matrix.run-on-os }}" == "macos"* ]]; then
sed -i.bak "/defaultConfig {/a\\
ndkVersion \"$NDK_VERSION\"
" app/build.gradle
else
sed -i "/defaultConfig {/a\\ ndkVersion \"$NDK_VERSION\"" app/build.gradle
fi
chmod +x gradlew
./gradlew assembleDebug
Expand Down

0 comments on commit 5140b0e

Please sign in to comment.