-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
62 lines (49 loc) · 1.88 KB
/
Copy pathtest-ohos-build.yml
File metadata and controls
62 lines (49 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Test OHOS build
on:
push:
branches: [feat/ohos-support]
workflow_dispatch:
env:
NODE_VERSION: 24
PNPM_VERSION: '9.6.0'
OXIDE_LOCATION: ./crates/node
jobs:
build-ohos:
name: Build aarch64-unknown-linux-ohos (oxide)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup rust target
run: rustup target add aarch64-unknown-linux-ohos
- name: Setup OpenHarmony SDK
uses: Boshen/setup-ohos-sdk@edb865a89a712f1f15dbad932dfa9cfce849d95c # v1.0.0
- name: Configure OHOS linker
run: |
echo "${OHOS_SDK_NATIVE}/llvm/bin" >> $GITHUB_PATH
cat > /tmp/aarch64-linux-ohos-clang <<'WRAPPER'
#!/bin/sh
exec ${OHOS_SDK_NATIVE}/llvm/bin/clang --target=aarch64-linux-ohos "$@"
WRAPPER
chmod +x /tmp/aarch64-linux-ohos-clang
- name: Install dependencies
run: pnpm install --ignore-scripts --frozen-lockfile --filter=!./playgrounds/*
- name: Build release
run: pnpm run --filter ${{ env.OXIDE_LOCATION }} build:platform --target=aarch64-unknown-linux-ohos
env:
RUST_TARGET: aarch64-unknown-linux-ohos
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_LINKER: /tmp/aarch64-linux-ohos-clang
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_OHOS_RUSTFLAGS: -C link-arg=-fuse-ld=lld -C link-arg=-lm
- name: Strip debug symbols
run: ${OHOS_SDK_NATIVE}/llvm/bin/llvm-strip ${{ env.OXIDE_LOCATION }}/*.node
- name: List artifacts
run: ls -lh ${{ env.OXIDE_LOCATION }}/*.node