Skip to content

Commit 63975c3

Browse files
authored
ci: check android & ios (#922)
* ci: check android & ios * fix(driver): build on armv7 android * fix(tls): ignore rcgen test on iOS * ci(android): use ndk-env * ci(android): install cargo-ndk * fix(ws): ignore from_pkcs8 warnings * ci(android): disable python
1 parent 2e1a8f6 commit 63975c3

5 files changed

Lines changed: 95 additions & 1 deletion

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Check Android
2+
3+
on:
4+
merge_group:
5+
types: [checks_requested]
6+
push:
7+
branches:
8+
- master
9+
paths:
10+
- '**/*.rs'
11+
- '**/Cargo.toml'
12+
- '.github/workflows/ci_check_android.yml'
13+
pull_request:
14+
branches:
15+
- master
16+
paths:
17+
- '**/*.rs'
18+
- '**/Cargo.toml'
19+
- '.github/workflows/ci_check_android.yml'
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
check_android:
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
target:
31+
- aarch64-linux-android
32+
- armv7-linux-androideabi
33+
- x86_64-linux-android
34+
steps:
35+
- uses: actions/checkout@v6
36+
- name: Setup Rust Toolchain
37+
run: |
38+
rustup default nightly
39+
rustup target add ${{ matrix.target }}
40+
rustup component add clippy
41+
- uses: taiki-e/install-action@v2
42+
with:
43+
tool: cargo-ndk
44+
- name: Check clippy
45+
shell: bash
46+
run: |
47+
source <(cargo ndk-env --target ${{ matrix.target }})
48+
cargo clippy --target ${{ matrix.target }} --features all,nightly,sync,ring,native-tls-vendored,compat-all --all-targets -- -Dwarnings

.github/workflows/ci_check_ios.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Check iOS
2+
3+
on:
4+
merge_group:
5+
types: [checks_requested]
6+
push:
7+
branches:
8+
- master
9+
paths:
10+
- '**/*.rs'
11+
- '**/Cargo.toml'
12+
- '.github/workflows/ci_check_ios.yml'
13+
pull_request:
14+
branches:
15+
- master
16+
paths:
17+
- '**/*.rs'
18+
- '**/Cargo.toml'
19+
- '.github/workflows/ci_check_ios.yml'
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
check_ios:
27+
runs-on: macos-latest
28+
strategy:
29+
matrix:
30+
target:
31+
- aarch64-apple-ios
32+
- aarch64-apple-ios-macabi
33+
steps:
34+
- uses: actions/checkout@v6
35+
- name: Setup Rust Toolchain
36+
run: |
37+
rustup default nightly
38+
rustup target add ${{ matrix.target }}
39+
rustup component add clippy
40+
- name: Check clippy
41+
shell: bash
42+
run: |
43+
cargo clippy --target ${{ matrix.target }} --all-features --all-targets -- -Dwarnings

compio-driver/src/sys/pal/unix/socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ unsafe impl SocketAddrArg for SockAddrArg<'_> {
99
&self,
1010
f: impl FnOnce(*const SocketAddrOpaque, SocketAddrLen) -> R,
1111
) -> R {
12-
f(self.0.as_ptr().cast(), self.0.len())
12+
f(self.0.as_ptr().cast(), self.0.len() as _)
1313
}
1414
}
1515

compio-tls/tests/echo.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ async fn connect(connector: TlsConnector, addr: SocketAddr) {
3232
}
3333

3434
#[cfg(feature = "native-tls")]
35+
#[allow(deprecated)] // On iOS, `from_pkcs8` is not implemented.
36+
#[cfg_attr(target_os = "ios", ignore)]
3537
#[compio_macros::test]
3638
async fn native() {
3739
// https://github.com/rustls/rcgen/issues/91

compio-ws/examples/echo_server_tls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use tungstenite::Message;
1111
// openssl req -x509 -newkey rsa:2048 -keyout localhost.key -out localhost.crt
1212
// -days 365 -nodes -subj "/CN=localhost"
1313
#[cfg(feature = "native-tls")]
14+
#[allow(deprecated)] // On iOS, `from_pkcs8` is not implemented.
1415
async fn create_tls_acceptor() -> Result<TlsAcceptor, Box<dyn std::error::Error>> {
1516
use compio_tls::native_tls;
1617

0 commit comments

Comments
 (0)