Add ock artefact building #30
This file contains 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
# Simple workflow for running non-documentation PR testing | ||
name: Run ock tests for PR testing | ||
on: | ||
workflow_call: | ||
inputs: | ||
ock: | ||
required: false | ||
type: boolean | ||
default: true | ||
test_tornado: | ||
required: false | ||
type: boolean | ||
default: true | ||
target_list: | ||
required: false | ||
type: string | ||
llvm_version: | ||
required: false | ||
type: string | ||
default: 19 | ||
pull_request: | ||
required: false | ||
type: bool | ||
default: false | ||
jobs: | ||
# Calculate some useful variables that can be used through the workflow | ||
# Currently this can be used to exclude all but certain targets in matrices | ||
workflow_vars: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
matrix_only_linux_x86_64_aarch64: ${{ steps.vars.outputs.matrix_only_linux_x86_64_aarch64 }} | ||
matrix_only_linux_x86_64: ${{ steps.vars.outputs.matrix_only_linux_x86_64 }} | ||
steps: | ||
- id: vars | ||
run: | | ||
echo matrix_only_linux_x86_64_aarch64="[ {\"target\": \"host_arm_linux\"}, {\"target\": \"host_refsi_linux\"}, {\"target\": \"host_i686_linux\"}, {\"target\": \"host_x86_64_windows\"}]" >> $GITHUB_OUTPUT | ||
echo matrix_only_linux_x86_64="[ {\"target\": \"host_aarch64_linux\"}, {\"target\": \"host_arm_linux\"}, {\"target\": \"host_refsi_linux\"}, {\"target\": \"host_i686_linux\"}, {\"target\": \"host_x86_64_windows\"}]" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT | ||
create_ock_artefacts: | ||
needs: [workflow_vars] | ||
strategy: | ||
matrix: | ||
target: ${{ fromJson(inputs.target_list) }} | ||
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }} | ||
runs-on: ${{ (contains(matrix.target, 'host_riscv') && 'ubuntu-24.04') || (contains(matrix.target, 'windows') && 'windows-2019' || 'ubuntu-22.04' ) }} | ||
if : inputs.ock | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: build ock artefact | ||
uses: ./.github/actions/do_build_ock_artefact | ||
with: | ||
target: ${{ matrix.target }} | ||
llvm_version: ${{ inputs.llvm_version }} | ||
build_icd: | ||
# Will also be required for opencl | ||
if: inputs.test_tornado | ||
needs: [workflow_vars] | ||
strategy: | ||
matrix: | ||
target: ${{ fromJson(inputs.target_list) }} | ||
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: clone ock platform | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
platform | ||
.github | ||
# The following can also be done with the matrix with exclude: to limit the targets to what we want | ||
- name : build and upload icd ${{matrix.target}} | ||
uses: ./.github/actions/do_build_icd | ||
with: | ||
target: ${{matrix.target}} | ||
# Currently only builds and runs on x86_64 linux | ||
build_cts: | ||
if: inputs.test_opencl_cts | ||
needs: [ workflow_vars, build_icd ] | ||
strategy: | ||
matrix: | ||
target: ${{ fromJson(inputs.target_list) }} | ||
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }} | ||
# Todo: expand for aarch64 | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: clone ock platform | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
platform | ||
.github | ||
# TODO: Consider separating out tornado build and run in the future | ||
- name : build and upload tornado | ||
uses: ./.github/actions/do_build_tornado | ||
with: | ||
target: ${{ matrix.target }} | ||
- name : run tornado | ||
uses: ./.github/actions/run_tornado | ||
with: | ||
target: ${{ matrix.target }} | ||
# Todo: expand for aarch64 | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: clone ock platform | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
platform | ||
.github | ||
# TODO: Consider separating out tornado build and run in the future | ||
- name : build and upload tornado | ||
uses: ./.github/actions/do_build_tornado | ||
with: | ||
target: ${{ matrix.target }} | ||
- name : run tornado | ||
uses: ./.github/actions/run_tornado | ||
with: | ||
target: ${{ matrix.target }} |