Skip to content

Commit

Permalink
add harmonyos ci (#5474)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored May 27, 2024
1 parent d4292e9 commit 86e1ed0
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- 'src/layer/*'
- 'src/layer/arm/**'
- 'src/layer/x86/**'
- 'src/layer/mips/**'
- 'src/layer/vulkan/**'
pull_request:
branches: [master]
Expand All @@ -22,7 +21,6 @@ on:
- 'src/layer/*'
- 'src/layer/arm/**'
- 'src/layer/x86/**'
- 'src/layer/mips/**'
- 'src/layer/vulkan/**'
concurrency:
group: android-${{ github.ref }}
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/harmonyos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: harmonyos
on:
push:
branches: [master]
paths:
- '.github/workflows/harmonyos.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/arm/**'
- 'src/layer/x86/**'
- 'src/layer/vulkan/**'
pull_request:
branches: [master]
paths:
- '.github/workflows/harmonyos.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/arm/**'
- 'src/layer/x86/**'
- 'src/layer/vulkan/**'
concurrency:
group: harmonyos-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read

jobs:
build:
runs-on: [self-hosted, linux, centos]

env:
OHOS_NDK_HOME: /data/action/osd/ohos-sdk/linux/native
OHOS_NDK_CMAKE: /data/action/osd/ohos-sdk/linux/native/build-tools/cmake/bin/cmake
NCNN_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=/data/action/osd/ohos-sdk/linux/native/build/cmake/ohos.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_BUILD_TYPE=Release \
-DNCNN_SIMPLEOMP=ON \
-DNCNN_VULKAN=ON \
steps:
- uses: actions/checkout@v4
with:
submodules: true

# - name: setup-sdk
# run: |
# cd /data/action/osd
# wget -q https://repo.huaweicloud.com/harmonyos/os/4.1.1-Release/ohos-sdk-windows_linux-public.tar.gz
# tar -xf ohos-sdk-windows_linux-public.tar.gz
# cd ohos-sdk/linux
# unzip -q native-linux-x64-4.1.7.8-Release.zip

- name: armeabi-v7a
run: |
mkdir build-armeabi-v7a && cd build-armeabi-v7a
${{ env.OHOS_NDK_CMAKE }} ${{ env.NCNN_CMAKE_OPTIONS }} -DOHOS_ARCH="armeabi-v7a" ..
${{ env.OHOS_NDK_CMAKE }} --build . -j 4
- name: arm64-v8a
run: |
mkdir build-arm64-v8a && cd build-arm64-v8a
${{ env.OHOS_NDK_CMAKE }} ${{ env.NCNN_CMAKE_OPTIONS }} -DOHOS_ARCH="arm64-v8a" ..
${{ env.OHOS_NDK_CMAKE }} --build . -j 4
- name: x86_64
run: |
mkdir build-x86_64 && cd build-x86_64
${{ env.OHOS_NDK_CMAKE }} ${{ env.NCNN_CMAKE_OPTIONS }} -DOHOS_ARCH="x86_64" ..
${{ env.OHOS_NDK_CMAKE }} --build . -j 4
- name: armeabi-v7a-shared
run: |
mkdir build-armeabi-v7a-shared && cd build-armeabi-v7a-shared
${{ env.OHOS_NDK_CMAKE }} ${{ env.NCNN_CMAKE_OPTIONS }} -DOHOS_ARCH="armeabi-v7a" -DNCNN_SHARED_LIB=ON ..
${{ env.OHOS_NDK_CMAKE }} --build . -j 4
- name: arm64-v8a-shared
run: |
mkdir build-arm64-v8a-shared && cd build-arm64-v8a-shared
${{ env.OHOS_NDK_CMAKE }} ${{ env.NCNN_CMAKE_OPTIONS }} -DOHOS_ARCH="arm64-v8a" -DNCNN_SHARED_LIB=ON ..
${{ env.OHOS_NDK_CMAKE }} --build . -j 4
- name: x86_64-shared
run: |
mkdir build-x86_64-shared && cd build-x86_64-shared
${{ env.OHOS_NDK_CMAKE }} ${{ env.NCNN_CMAKE_OPTIONS }} -DOHOS_ARCH="x86_64" -DNCNN_SHARED_LIB=ON ..
${{ env.OHOS_NDK_CMAKE }} --build . -j 4
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,32 @@ https://github.com/Tencent/ncnn/releases/latest
</td>
</tr>

<tr>
<td rowspan=3>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/37/HMOS_Logo_Icon.svg/240px-HMOS_Logo_Icon.svg.png" width="120" height="auto">
</td>
<td colspan=3>

</td>
</tr>
<tr>
<td>HarmonyOS</td>
<td>

</td>
<td rowspan=2>

[<img src="https://img.shields.io/github/actions/workflow/status/Tencent/ncnn/harmonyos.yml?branch=master&style=for-the-badge&label=build">](https://github.com/Tencent/ncnn/actions?query=workflow%3Aharmonyos)

</td>
</tr>
<tr>
<td>HarmonyOS shared</td>
<td>

</td>
</tr>

<tr>
<td rowspan=3>
<img src="https://user-images.githubusercontent.com/25181517/121406611-a8246b80-c95e-11eb-9b11-b771486377f6.png" width="120" height="auto">
Expand Down

0 comments on commit 86e1ed0

Please sign in to comment.