Skip to content

Add ock artefact building #4

Add ock artefact building

Add ock artefact building #4

Workflow file for this run

# 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
target_list:
required: false
type: string
default: '["x86_64", "aarch64", "riscv64"]'
os_list:
required: false
type: string
default: '["ubuntu-22.04", "windows-2019"]'
update_cache:
required: false
type: boolean
default: false
# target_host_x86_64_windows:
# required: false
# type: boolean
# default: false
# target_host_aarch64_linux:
# required: false
# type: boolean
# default: true
llvm_version:
required: false
type: string
default: 18
env:
target_list: '["x86_64","aarch64", "riscv64"]'
os_list: '["ubuntu-22.04", "windows-2019"]'
jobs:
calc_matrix:
runs-on: ubuntu-latest
name: Calc matrix
outputs:
target_list: ${{ steps.step1.outputs.target_list }}
os_list: ${{ steps.step1.outputs.os_list }}
steps:
- id: step1
run: |
# echo "target_list=$target_list" >> "$GITHUB_OUTPUT"
# echo "os_list=$os_list" >> "$GITHUB_OUTPUT"
echo 'target_list=${{ inputs.target_list }}' >> "$GITHUB_OUTPUT"
echo 'os_list=${{ inputs.os_list }}' >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
create_ock_artefacts:
needs: calc_matrix
strategy:
matrix:
target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
build_type: [RelAssert]
exclude:
- os: windows-2019
- target: riscv64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
# TODO: Move this to a single action
- name: load native llvm
if: ${{ matrix.target }} != "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"
uses: actions/cache/restore@v4
with:
path: llvm_install/**
key: llvm-ubuntu-22.04-x86_64-v19-RelAssert
fail-on-cache-miss: true
- run: mv llvm_install llvm_install_native
if: ${{ matrix.target }} != "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"

Check failure on line 82 in .github/workflows/planned_testing.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/planned_testing.yml

Invalid workflow file

You have an error in your yaml syntax on line 82
- name: setup-ubuntu
uses: ./.github/actions/setup_build
with:
llvm_version: '19'
llvm_build_type: RelAssert
save: ${{ inputs.update_cache }}
arch: aarch64
# installs tools, ninja, installs llvm and sets up sccache
- name: setup-ubuntu
if: ${{ matrix.target }} == "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"
uses: ./.github/actions/setup_build
with:
llvm_version: 18
llvm_build_type: RelAssert
# For now target and arch match
arch: $ {{ matrix.target }}
save: ${{ inputs.update_cache }}
- name: build ock x86
if: ${{ matrix.target }} == "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"
uses: ./.github/actions/do_build_ock
with:
build_target: install
- name: build ock other ${{ matrix.target }}
if: ${{ matrix.target }} == "aarch64" && ${{ matrix.os }} == "ubuntu-22.04"
uses: ./.github/actions/do_build_ock
with:
build_target: install
toolchain_file: "platform/arm-linux/aarch64-toolchain.cmake"
extra_flags: -DCA_BUILTINS_TOOLS_DIR=${{ github.workspace }}/llvm_install_native/bin
- name: upload ock artefact
if: ${{ matrix.target }} == "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"
uses: actions/upload-artifact@v4
with:
name: ock_${{matrix.os}}_${{matrix.target}}
path: install
retention-days: 1
# use_ock_artefacts_all:
# needs: [ calc_matrix, create_ock_artefacts ]
# strategy:
# matrix:
# target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
# build_type: [RelAssert]
# exclude:
# - os: windows-2019
# target: aarch64
# - os: windows-2019
# target: riscv64
use_ock_artefacts_ubuntu_x86_aarch64:
needs: [ calc_matrix, create_ock_artefacts ]
strategy:
matrix:
target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
build_type: [RelAssert]
exclude:
- os: windows-2019
- target: riscv64
- target: aarch64
runs-on: ${{ matrix.os }}
steps:
- name: Download ock artefact
if: ${{ matrix.os }} == "x86_64"
uses: actions/download-artifact@v4
with:
name: ock_${{matrix.os}}_${{matrix.target}}
- name: print ock artefact
if: ${{ matrix.os }} == "x86_64"
run: |
ls -R .
# echo "${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.arch }}" > foo.txt
# --define CA_CL_ENABLE_ICD_LOADER=ON
# --define OCL_EXTENSION_cl_khr_command_buffer=ON
# --define OCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=ON
# --define OCL_EXTENSION_cl_khr_extended_async_copies=ON
# --target check-ock
# -B build