|
| 1 | +name: E2E Test |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [master] |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + e2e-test: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + timeout-minutes: 45 |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + submodules: recursive |
| 16 | + |
| 17 | + - uses: actions/setup-java@v4 |
| 18 | + with: |
| 19 | + distribution: jetbrains |
| 20 | + java-version: 21 |
| 21 | + |
| 22 | + - uses: dtolnay/rust-toolchain@stable |
| 23 | + with: |
| 24 | + targets: x86_64-linux-android |
| 25 | + |
| 26 | + - name: Enable KVM |
| 27 | + run: | |
| 28 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \ |
| 29 | + | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 30 | + sudo udevadm control --reload-rules |
| 31 | + sudo udevadm trigger --name-match=kvm |
| 32 | +
|
| 33 | + - name: Gradle cache |
| 34 | + uses: actions/cache@v4 |
| 35 | + with: |
| 36 | + path: | |
| 37 | + ~/.gradle/caches |
| 38 | + ~/.gradle/wrapper |
| 39 | + key: gradle-${{ hashFiles('**/*.gradle*', 'gradle/wrapper/gradle-wrapper.properties') }} |
| 40 | + |
| 41 | + - name: Cargo cache |
| 42 | + uses: actions/cache@v4 |
| 43 | + with: |
| 44 | + path: | |
| 45 | + ~/.cargo/registry |
| 46 | + ~/.cargo/git |
| 47 | + core/src/main/rust/shadowsocks-rust/target |
| 48 | + key: cargo-${{ hashFiles('core/src/main/rust/shadowsocks-rust/Cargo.lock') }} |
| 49 | + |
| 50 | + - name: Build debug APK (x86_64) |
| 51 | + run: ./gradlew assembleDebug -PCARGO_PROFILE=debug -PTARGET_ABI=x86_64 |
| 52 | + |
| 53 | + - name: Build ssserver |
| 54 | + run: | |
| 55 | + cd core/src/main/rust/shadowsocks-rust |
| 56 | + cargo build --release --bin ssserver --features "server,aead-cipher,logging" |
| 57 | +
|
| 58 | + - name: E2E Test |
| 59 | + uses: ReactiveCircus/android-emulator-runner@v2 |
| 60 | + with: |
| 61 | + api-level: 34 |
| 62 | + target: google_apis |
| 63 | + arch: x86_64 |
| 64 | + force-avd-creation: true |
| 65 | + emulator-options: >- |
| 66 | + -no-snapshot-save -no-window -gpu swiftshader_indirect |
| 67 | + -noaudio -no-boot-anim |
| 68 | + disable-animations: true |
| 69 | + script: bash test-e2e.sh |
| 70 | + env: |
| 71 | + SKIP_EMULATOR_BOOT: "true" |
| 72 | + ADB: adb |
| 73 | + APK: ${{ github.workspace }}/mobile/build/outputs/apk/debug/mobile-x86_64-debug.apk |
| 74 | + SSSERVER: ${{ github.workspace }}/core/src/main/rust/shadowsocks-rust/target/release/ssserver |
| 75 | + |
| 76 | + - name: Upload screenshots |
| 77 | + uses: actions/upload-artifact@v4 |
| 78 | + if: always() |
| 79 | + with: |
| 80 | + name: e2e-screenshots |
| 81 | + path: screen_*.png |
0 commit comments