Fix lint issues + run lint in CI #29
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: Build and test | |
on: | |
push: | |
# branches: ["master"] | |
pull_request: | |
env: | |
PCAPPLUSPLUS_LATEST_VERSION: 24.09 | |
jobs: | |
build-and-test: | |
strategy: | |
matrix: | |
api-level: [30, 33, 35] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: true | |
- name: Download PcapPlusPlus | |
uses: robinraju/release-downloader@v1 | |
with: | |
repository: "seladb/PcapPlusPlus" | |
tag: "v${{env.PCAPPLUSPLUS_LATEST_VERSION}}" | |
fileName: "pcapplusplus-${{env.PCAPPLUSPLUS_LATEST_VERSION}}-android.tar.gz" | |
out-file-path: "app/libs" | |
tarBall: true | |
extract: true | |
- name: Rename PcapPlusPlus directory | |
run: mv $GITHUB_WORKSPACE/app/libs/pcapplusplus-${PCAPPLUSPLUS_LATEST_VERSION}-android $GITHUB_WORKSPACE/app/libs/pcapplusplus | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "zulu" | |
cache: "gradle" | |
- name: Change wrapper permissions | |
run: chmod +x ./gradlew | |
- name: Run lint | |
run: ./gradlew lint | |
- name: Build gradle project and run tests | |
run: ./gradlew build | |
- name: Enable KVM | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: Run instrumentation tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
script: ./gradlew -is connectedCheck |