| # Copyright 2022 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 |
| |
| on: |
| workflow_call: |
| inputs: |
| host-binary-root: |
| required: true |
| type: string |
| |
| jobs: |
| riscv32: |
| runs-on: |
| # self-hosted has to be listed first. See |
| # https://docs.github.com/en/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow |
| - self-hosted |
| # Have to do a weird hack to get a pseudo-ternary operator. See |
| # https://github.com/actions/runner/issues/409. Also note that |
| # `github.event_name` for workflow_call is the name of the calling event, |
| # which is poorly documented, but useful for us here. See |
| # https://github.com/github/docs/issues/16515 |
| - runner-group=${{ github.event_name == 'pull_request' && 'presubmit' || 'postsubmit' }} |
| - cpu |
| - os-family=Linux |
| env: |
| BUILD_RISCV_DIR: "build-riscv-rv32-baremetal" |
| RISCV_CONFIG: "rv32-baremetal" |
| HOST_BINARY_ARCHIVE: ${{ inputs.host-binary-root }}.tar |
| HOST_BINARY_ROOT: ${{ inputs.host-binary-root }} |
| steps: |
| - name: "Checking out repository" |
| uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2 |
| with: |
| submodules: true |
| - name: "Downloading host tools" |
| uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0 |
| with: |
| name: "${{ env.HOST_BINARY_ARCHIVE }}" |
| - name: "Extracting host tools archive" |
| run: | |
| tar -xvf ${HOST_BINARY_ARCHIVE} |
| - name: "Cross-compiling and testing riscv32" |
| run: | |
| ./build_tools/github_actions/docker_run.sh \ |
| --env "RISCV_CONFIG=${RISCV_CONFIG}" \ |
| --env "BUILD_RISCV_DIR=${BUILD_RISCV_DIR}" \ |
| --env "IREE_HOST_BINARY_ROOT=${HOST_BINARY_ROOT}" \ |
| gcr.io/iree-oss/riscv@sha256:e566f054ff1b1d8be61459ce4789dd944b70e85c8939a4d3b7331ab519d8db4c \ |
| bash -c \ |
| "./build_tools/cmake/build_riscv.sh && build_tools/kokoro/gcp_ubuntu/cmake/baremetal/riscv32/test.sh" |