Skip to content

Commit c81ba26

Browse files
committed
Harmony port: Workflows
1 parent 1e0b117 commit c81ba26

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'Setup Harmony toolchain'
2+
inputs:
3+
version:
4+
description: 'Harmony version'
5+
default: '5.0.0-Release'
6+
runs:
7+
using: 'composite'
8+
steps:
9+
- uses: actions/cache/restore@v4
10+
id: restore-cache
11+
with:
12+
path: /opt/native
13+
key: harmony-${{ inputs.version }}
14+
15+
- name: Download Harmony toolchain
16+
if: ${{ !steps.restore-cache.outputs.cache-hit }}
17+
shell: bash
18+
run: |
19+
wget https://repo.huaweicloud.com/openharmony/os/${{ inputs.version }}/ohos-sdk-windows_linux-public.tar.gz
20+
tar -zxvf ohos-sdk-windows_linux-public.tar.gz
21+
mkdir -p /opt
22+
23+
unzip linux/native*.zip -d /opt
24+
- uses: actions/cache/save@v4
25+
if: ${{ !steps.restore-cache.outputs.cache-hit }}
26+
with:
27+
path: /opt/native
28+
key: harmony-${{ inputs.version }}
29+
- name: 'Set output vars'
30+
id: final
31+
shell: bash
32+
run: |
33+
echo "HARMONY_NATIVE_SDK=/opt/native" >> $GITHUB_OUTPUT

.github/workflows/create-test-plan.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class SdlPlatform(Enum):
5555
FreeBSD = "freebsd"
5656
NetBSD = "netbsd"
5757
NGage = "ngage"
58+
Harmony = "harmony"
5859

5960

6061
class Msys2Platform(Enum):
@@ -141,6 +142,7 @@ class JobSpec:
141142
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
142143
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
143144
"ngage": JobSpec(name="N-Gage", os=JobOs.WindowsLatest, platform=SdlPlatform.NGage, artifact="SDL-ngage", ),
145+
"harmony": JobSpec(name="Harmony", os=JobOs.UbuntuLatest, platform=SdlPlatform.Harmony, artifact="SDL-harmony-arm64", harmony_arch="arm64-v8a"),
144146
}
145147

146148

@@ -757,6 +759,15 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
757759
job.setup_gage_sdk_path = "C:/ngagesdk"
758760
job.cmake_toolchain_file = "C:/ngagesdk/cmake/ngage-toolchain.cmake"
759761
job.test_pkg_config = False
762+
case SdlPlatform.Harmony:
763+
job.cmake_arguments.extend((
764+
f"-DOHOS_ARCH={spec.harmony_arch}",
765+
"-DCMAKE_TOOLCHAIN_FILE=/opt/native/build/cmake/ohos.toolchain.cmake",
766+
))
767+
job.shared_lib = SharedLibType.SO_0
768+
job.static_lib = StaticLibType.A
769+
job.run_tests = False
770+
job.test_pkg_config = False
760771
case _:
761772
raise ValueError(f"Unsupported platform={spec.platform}")
762773

0 commit comments

Comments
 (0)