Try again #73
Workflow file for this run
This file contains hidden or 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-client: | |
| strategy: | |
| matrix: | |
| api-level: [30, 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 Gradle lint | |
| run: ./gradlew lint | |
| - name: Run ktlint | |
| run: ./gradlew ktlintCheck | |
| - 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 | |
| build-server: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| submodules: true | |
| - name: Get Distribution Version | |
| id: distro_version | |
| run: | | |
| DISTRO_VERSION=$(lsb_release -r -s) | |
| echo "DISTRO_VERSION=$DISTRO_VERSION" >> $GITHUB_ENV | |
| - name: Download PcapPlusPlus | |
| uses: robinraju/release-downloader@v1 | |
| with: | |
| repository: "seladb/PcapPlusPlus" | |
| tag: "v${{env.PCAPPLUSPLUS_LATEST_VERSION}}" | |
| fileName: "pcapplusplus-${{env.PCAPPLUSPLUS_LATEST_VERSION}}-ubuntu-${{env.DISTRO_VERSION}}-gcc-*.tar.gz" | |
| out-file-path: "server/linux/libs" | |
| tarBall: true | |
| extract: true | |
| - name: Rename PcapPlusPlus directory | |
| run: | | |
| export RELEASE_DIR=$(find "$GITHUB_WORKSPACE/server/linux/libs" -maxdepth 1 -type d -name 'pcapplusplus*' | head -n 1) | |
| if [ -z "$RELEASE_DIR" ]; then | |
| echo "Error: No directory matching 'pcapplusplus*' found." | |
| exit 1 | |
| fi | |
| echo Release dir: $RELEASE_DIR | |
| mv $RELEASE_DIR $GITHUB_WORKSPACE/server/linux/libs/pcapplusplus | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update && sudo apt -y install libpcap-dev | |
| - name: Build VPN server | |
| run: | | |
| cd server/linux | |
| cmake -S . -B build | |
| cmake --build build | |
| cpp-lint-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| submodules: true | |
| - name: Run clang-format | |
| uses: jidicula/clang-format-action@v4.14.0 | |
| with: | |
| clang-format-version: "19" | |
| exclude-regex: "(^|/)(app/libs|server/linux/libs)/" |