Skip to content

Commit

Permalink
ci: add openharmony ci (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
richerfu authored Nov 25, 2024
1 parent aab6d91 commit 30385ce
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,38 @@ jobs:
cargo lipo --verbose --all-features --features="async tokio/rt-multi-thread"
- name: Abort on error
if: ${{ failure() }}
run: echo "iOs build job failed" && false
run: echo "iOS build job failed" && false

build_n_test_openharmony:
strategy:
matrix:
target: [aarch64-unknown-linux-ohos, armv7-unknown-linux-ohos, x86_64-unknown-linux-ohos]
fail-fast: false
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: openharmony-rs/setup-ohos-sdk@v0.1
id: setup-ohos
with:
version: "5.0"
- name: Install ohrs and rust compiler for ohos target
if: ${{ !cancelled() }}
run: |
cargo install --locked ohrs
rustup target add ${{ matrix.target }}
- name: fmt & clippy
if: ${{ !cancelled() }}
run: |
ohrs cargo --disable-target -- fmt --all -- --check
ohrs cargo --disable-target -- clippy --target ${{matrix.target}} --all-features --features="async tokio/rt-multi-thread" -- -D warnings
- name: Build
if: ${{ !cancelled() }}
run: |
ohrs cargo --disable-target -- rustc --target ${{matrix.target}} --verbose --all-features --features="async tokio/rt-multi-thread" --lib --crate-type=cdylib
- name: Abort on error
if: ${{ failure() }}
run: echo "OpenHarmony build job failed" && false

semver:
name: Check semver
Expand Down
7 changes: 2 additions & 5 deletions src/platform/posix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
//! POSIX compliant support.
mod sockaddr;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))]
pub(crate) use sockaddr::sockaddr_union;

#[cfg(any(target_os = "linux", target_os = "macos"))]
pub(crate) use sockaddr::ipaddr_to_sockaddr;
#[allow(unused_imports)]
pub(crate) use sockaddr::{ipaddr_to_sockaddr, sockaddr_union};

mod fd;
pub(crate) use self::fd::Fd;
Expand Down
2 changes: 1 addition & 1 deletion src/platform/posix/sockaddr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn rs_addr_to_sockaddr(addr: std::net::SocketAddr) -> sockaddr_union {

/// # Safety
/// Fill the `addr` with the `src_addr` and `src_port`, the `size` should be the size of overwriting
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[allow(dead_code)]
pub(crate) unsafe fn ipaddr_to_sockaddr<T>(
src_addr: T,
src_port: u16,
Expand Down

0 comments on commit 30385ce

Please sign in to comment.