| # Copyright 2024 The IREE Authors |
| # |
| # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| # See https://llvm.org/LICENSE.txt for license information. |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| |
| # Workflow for RISCV64 cross-compilation and test jobs. |
| # The concurrency of this workflow is controlled by the caller's job. |
| |
| name: PkgCI Test RISCV64 |
| |
| on: |
| workflow_call: |
| inputs: |
| artifact_run_id: |
| type: string |
| default: "" |
| write-caches: |
| required: true |
| type: string |
| workflow_dispatch: |
| inputs: |
| artifact_run_id: |
| type: string |
| default: "" |
| write-caches: |
| required: true |
| type: string |
| |
| permissions: |
| contents: read |
| |
| jobs: |
| riscv64: |
| runs-on: ubuntu-20.04 |
| env: |
| PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages |
| VENV_DIR: ${{ github.workspace }}/.venv |
| CC: clang |
| CXX: clang++ |
| BOOTSTRAP_WORK_DIR: ${{ github.workspace }}/.bootstrap |
| RISCV_RV64_LINUX_TOOLCHAIN_ROOT: ${{ github.workspace }}/riscv/toolchain |
| QEMU_PATH_PREFIX: ${{ github.workspace }}/riscv/qemu |
| steps: |
| # General setup. |
| - name: "Checking out repository" |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| - name: "Checking out runtime submodules" |
| run: ./build_tools/scripts/git/update_runtime_submodules.sh |
| - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.1.0 |
| with: |
| # Must match the subset of versions built in pkgci_build_packages. |
| python-version: "3.11" |
| - name: ccache |
| uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14 |
| with: |
| key: ${{ github.job }} |
| save: ${{ inputs.write-caches == 1 }} |
| - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
| with: |
| name: linux_x86_64_release_packages |
| path: ${{ env.PACKAGE_DOWNLOAD_DIR }} |
| - name: Install build dependencies |
| run: sudo apt update && sudo apt install -y ninja-build |
| - name: Setup base venv |
| run: | |
| ./build_tools/pkgci/setup_venv.py ${VENV_DIR} \ |
| --artifact-path=${PACKAGE_DOWNLOAD_DIR} \ |
| --fetch-gh-workflow=${{ inputs.artifact_run_id }} |
| - name: Bootstrap |
| env: |
| IREE_ARTIFACT_URL: "https://sharkpublic.blob.core.windows.net/sharkpublic/GCP-Migration-Files" |
| RISCV_CLANG_TOOLCHAIN_FILE_NAME: "toolchain_iree_manylinux_2_28_20231012.tar.gz" |
| QEMU_FILE_NAME: "qemu-riscv_8.1.2_manylinux_2.28_20231026.tar.gz" |
| run: | |
| mkdir -p ${{ env.BOOTSTRAP_WORK_DIR }} |
| mkdir -p ${{ env.RISCV_RV64_LINUX_TOOLCHAIN_ROOT }} |
| mkdir -p ${{ env.QEMU_PATH_PREFIX }} |
| wget --progress=bar:force:noscroll --directory-prefix="${BOOTSTRAP_WORK_DIR}" "${IREE_ARTIFACT_URL}/${RISCV_CLANG_TOOLCHAIN_FILE_NAME}" |
| tar -C "${{ env.RISCV_RV64_LINUX_TOOLCHAIN_ROOT }}" -xf "${BOOTSTRAP_WORK_DIR}/${RISCV_CLANG_TOOLCHAIN_FILE_NAME}" --no-same-owner --strip-components=1 |
| wget --progress=bar:force:noscroll --directory-prefix="${BOOTSTRAP_WORK_DIR}" "${IREE_ARTIFACT_URL}/${QEMU_FILE_NAME}" |
| tar -C "${{ env.QEMU_PATH_PREFIX }}" -xf "${BOOTSTRAP_WORK_DIR}/${QEMU_FILE_NAME}" --no-same-owner --strip-components=1 |
| - name: Build riscv64 |
| env: |
| IREE_HOST_BIN_DIR: ${{ env.VENV_DIR }}/bin |
| run: ./build_tools/cmake/build_riscv.sh |
| - name: Test riscv64 |
| env: |
| QEMU_RV64_BIN: ${{ env.QEMU_PATH_PREFIX }}/qemu-riscv64 |
| run: ./build_tools/cmake/test_riscv.sh |