Build HNP #640
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build HNP | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 2 * * *" | |
| env: | |
| OHOS_SDK_RELEASE_VERSION: "6.0.0.1" | |
| OHOS_SDK_VERSION: "6.0.0.48" | |
| OHOS_SDK_HOME: ${{ github.workspace }}/ohos-sdk/linux | |
| jobs: | |
| build-hnp: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Update Apt Cache | |
| run: sudo apt update | |
| - name: Free Disk Space | |
| uses: endersonmenezes/free-disk-space@v3 # Use @main for latest, @v3 for stable | |
| with: | |
| remove_android: true | |
| remove_dotnet: true | |
| remove_haskell: true | |
| remove_tool_cache: true | |
| remove_swap: true | |
| remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*" | |
| remove_packages_one_command: true | |
| remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle" | |
| rm_cmd: "rm" # Use 'rmz' for faster deletion (default: 'rm') | |
| rmz_version: "3.1.1" # Required when rm_cmd is 'rmz' | |
| testing: false | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt install -y build-essential cmake curl wget unzip python3 libncurses-dev \ | |
| git flex bison bash make autoconf libcurl4-openssl-dev tcl \ | |
| gettext zip pigz meson liblzma-dev | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| max-size: 2G | |
| - name: Cache OHOS Toolchain | |
| id: cache-toolchain # Assign an ID to this step to check its output later | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.OHOS_SDK_HOME }} | |
| key: ${{ runner.os }}-ohos-${{ env.OHOS_SDK_RELEASE_VERSION }} | |
| restore-keys: | | |
| ${{ runner.os }}-ohos-${{ env.OHOS_SDK_RELEASE_VERSION }} | |
| - name: Download OHOS SDK | |
| if: steps.cache-toolchain.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| curl -OL https://repo.huaweicloud.com/openharmony/os/${OHOS_SDK_RELEASE_VERSION}-Release/ohos-sdk-windows_linux-public.tar.gz | |
| tar -xzf ohos-sdk-windows_linux-public.tar.gz | |
| rm ohos-sdk-windows_linux-public.tar.gz | |
| rm -rf ohos-sdk/{ohos,windows} | |
| pushd ohos-sdk/linux | |
| for file in $(find . -type f); do | |
| unzip $file && rm $file | |
| done | |
| popd | |
| - name: Build hnp | |
| shell: bash | |
| run: | | |
| USE_CCACHE=1 OHOS_ARCH=aarch64 OHOS_ABI=arm64-v8a make -C build-hnp | |
| - name: Upload hnp | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: hnp | |
| path: | | |
| build-hnp/*.hnp | |
| retention-days: 7 |