|
10 | 10 |
|
11 | 11 | env:
|
12 | 12 | CARGO_TERM_COLOR: always
|
| 13 | + RUST_BACKTRACE: full |
13 | 14 |
|
14 | 15 | jobs:
|
15 | 16 | Build:
|
16 | 17 | name: ${{ format('{0} {1}', matrix.platform.target, matrix.features)}}
|
17 | 18 | runs-on: ${{ matrix.platform.os }}
|
18 |
| - env: |
19 |
| - RUST_BACKTRACE: 1 |
20 | 19 | strategy:
|
21 | 20 | fail-fast: false
|
22 | 21 | matrix:
|
@@ -58,12 +57,11 @@ jobs:
|
58 | 57 | sudo apt install gcc libxxf86vm-dev libosmesa6-dev libgles2-mesa-dev xvfb weston -y
|
59 | 58 | - name: Install rust
|
60 | 59 | id: toolchain
|
61 |
| - uses: dtolnay/rust-toolchain@stable |
| 60 | + uses: dtolnay/rust-toolchain@1.81.0 |
62 | 61 | with:
|
63 | 62 | targets: ${{ matrix.platform.target }}
|
64 | 63 | - name: Build
|
65 | 64 | run: |
|
66 |
| - rustup target add ${{ matrix.platform.target }} |
67 | 65 | cargo build --features "${{ matrix.features }}" --target ${{ matrix.platform.target }}
|
68 | 66 | - name: Test
|
69 | 67 | if: ${{ matrix.platform.test && startsWith(matrix.platform.os, 'ubuntu') }}
|
|
74 | 72 | if: ${{ matrix.platform.test && !startsWith(matrix.platform.os, 'ubuntu') }}
|
75 | 73 | run: |
|
76 | 74 | cargo test --features "${{ matrix.features }}" --target ${{ matrix.platform.target }}
|
| 75 | +
|
| 76 | + android-test: |
| 77 | + name: ${{ format('x86_64-linux-android {0}', matrix.features)}} |
| 78 | + runs-on: ubuntu-24.04 |
| 79 | + strategy: |
| 80 | + fail-fast: false |
| 81 | + matrix: |
| 82 | + features: |
| 83 | + [ |
| 84 | + "", |
| 85 | + "chains sm-raw-window-handle-06", |
| 86 | + "chains sm-raw-window-handle-05", |
| 87 | + ] |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v4 |
| 90 | + - name: Install rust |
| 91 | + id: toolchain |
| 92 | + uses: dtolnay/rust-toolchain@1.81.0 |
| 93 | + with: |
| 94 | + targets: x86_64-linux-android |
| 95 | + |
| 96 | + - uses: taiki-e/install-action@v2 |
| 97 | + with: |
| 98 | + tool: cargo-dinghy |
| 99 | + |
| 100 | + - name: Enable KVM |
| 101 | + run: | |
| 102 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 103 | + sudo udevadm control --reload-rules |
| 104 | + sudo udevadm trigger --name-match=kvm |
| 105 | +
|
| 106 | + - name: Run tests in android emulator |
| 107 | + uses: reactivecircus/android-emulator-runner@v2 |
| 108 | + env: |
| 109 | + RANLIB: "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" |
| 110 | + with: |
| 111 | + api-level: 30 |
| 112 | + arch: x86_64 |
| 113 | + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
| 114 | + disable-animations: true |
| 115 | + script: | |
| 116 | + cargo dinghy all-platforms |
| 117 | + cargo dinghy all-devices |
| 118 | + cargo dinghy -p auto-android-x86_64-api30 --env RUST_BACKTRACE=${{ env.RUST_BACKTRACE }} test --features "${{ matrix.features }}" -- --test-threads 1 |
| 119 | +
|
77 | 120 | Format:
|
78 | 121 | name: Run `rustfmt`
|
79 | 122 | runs-on: ubuntu-24.04
|
|
84 | 127 | build_result:
|
85 | 128 | name: Result
|
86 | 129 | runs-on: ubuntu-24.04
|
87 |
| - needs: ["Build", "Format"] |
| 130 | + needs: ["Build", "android-test", "Format"] |
88 | 131 | if: always()
|
89 | 132 | steps:
|
90 | 133 | - name: Mark the job as successful
|
|
0 commit comments