diff --git a/.github/actions/setup-harmony-toolchain/action.yml b/.github/actions/setup-harmony-toolchain/action.yml new file mode 100644 index 0000000000..b13a29888c --- /dev/null +++ b/.github/actions/setup-harmony-toolchain/action.yml @@ -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 diff --git a/.github/workflows/create-test-plan.py b/.github/workflows/create-test-plan.py index b711c02ede..2e85ed9f9c 100755 --- a/.github/workflows/create-test-plan.py +++ b/.github/workflows/create-test-plan.py @@ -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}")