Harmony port: Workflows

This commit is contained in:
Jack253-png 2025-05-30 19:28:10 +08:00
parent 3a4de2ad89
commit 462476f150
No known key found for this signature in database
GPG key ID: 51EA61206B02D886
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,33 @@
name: 'Setup Harmony toolchain'
inputs:
version:
description: 'Harmony version'
default: '5.0.0-Release'
runs:
using: 'composite'
steps:
- uses: actions/cache/restore@v4
id: restore-cache
with:
path: /opt/native
key: harmony-${{ inputs.version }}
- name: Download Harmony toolchain
if: ${{ !steps.restore-cache.outputs.cache-hit }}
shell: bash
run: |
wget https://repo.huaweicloud.com/openharmony/os/${{ inputs.version }}/ohos-sdk-windows_linux-public.tar.gz
tar -zxvf ohos-sdk-windows_linux-public.tar.gz
mkdir -p /opt
unzip linux/native*.zip -d /opt
- uses: actions/cache/save@v4
if: ${{ !steps.restore-cache.outputs.cache-hit }}
with:
path: /opt/native
key: harmony-${{ inputs.version }}
- name: 'Set output vars'
id: final
shell: bash
run: |
echo "HARMONY_NATIVE_SDK=/opt/native" >> $GITHUB_OUTPUT

View file

@ -55,6 +55,7 @@ class SdlPlatform(Enum):
FreeBSD = "freebsd"
NetBSD = "netbsd"
NGage = "ngage"
Harmony = "harmony"
class Msys2Platform(Enum):
@ -141,6 +142,7 @@ JOB_SPECS = {
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
"ngage": JobSpec(name="N-Gage", os=JobOs.WindowsLatest, platform=SdlPlatform.NGage, artifact="SDL-ngage", ),
"harmony": JobSpec(name="Harmony", os=JobOs.UbuntuLatest, platform=SdlPlatform.Harmony, artifact="SDL-harmony-arm64", harmony_arch="arm64-v8a"),
}
@ -757,6 +759,15 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.setup_gage_sdk_path = "C:/ngagesdk"
job.cmake_toolchain_file = "C:/ngagesdk/cmake/ngage-toolchain.cmake"
job.test_pkg_config = False
case SdlPlatform.Harmony:
job.cmake_arguments.extend((
f"-DOHOS_ARCH={spec.harmony_arch}",
"-DCMAKE_TOOLCHAIN_FILE=/opt/native/build/cmake/ohos.toolchain.cmake",
))
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
job.run_tests = False
job.test_pkg_config = False
case _:
raise ValueError(f"Unsupported platform={spec.platform}")