Skip to content

Add CI

Add CI #24

Workflow file for this run

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: 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