Skip to content

Commit

Permalink
TBD
Browse files Browse the repository at this point in the history
  • Loading branch information
coldav committed Nov 5, 2024
1 parent be927ac commit ec4aaec
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .github/actions/do_build_ock/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ inputs:
cxx_compiler:
description: "C++ compiler (default g++)"
default: "g++"
toolchain_file:
description: "Path to toolchain file"
default: ""

runs:
# We don't want a new docker just a list of steps, so mark as composite
Expand Down Expand Up @@ -166,6 +169,7 @@ runs:
-DCA_BUILD_32_BITS=${{ inputs.build_32_bit }}
-DCMAKE_C_COMPILER=${{ inputs.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ inputs.cxx_compiler }}
-DCMAKE_TOOLCHAIN_FILE=${{ inputs.toolchain_file }}
${{ inputs.extra_flags }}
.
- name: build_ock
Expand Down
10 changes: 9 additions & 1 deletion .github/actions/setup_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ runs:
sudo apt-get install --yes doxygen
sudo apt-get install --yes vulkan-sdk
if [ "${{ inputs.arch }}" = "x86" ]; then sudo apt-get install --yes gcc-multilib g++-multilib libc6-dev:i386 lib32tinfo-dev ; fi
# aarch64: Enable ability to install arm64 packages for cross compilation
# The main archive only hosts amd64 and i386, also add ports for arm64.
# Also install Arm/Aarch64 requirements
if [ "${{ inputs.arch }}" = "aarch64" ]; then \
# sudo dpkg --add-architecture arm64 ; \
sudo apt-get install --yes gcc-11-arm-linux-gnueabihf g++-11-arm-linux-gnueabihf; \
sudo apt-get install --yes gcc-11-aarch64-linux-gnu g++-11-aarch64-linux-gnu; \
fi
# sudo sed -i -e '/^deb /{h;s|deb |&[arch=amd64,i386] |p;g;s|deb http://[^ ]*|deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports|p;d}' /etc/apt/sources.list; \
- name: Install windows prerequisites
if: ${{ inputs.os == 'windows' }}
shell: pwsh
Expand Down
115 changes: 104 additions & 11 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
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
Expand All @@ -29,7 +33,7 @@ on:
default: 18

env:
target_list: '["x64","aarch64", "riscv64"]'
target_list: '["x86_64","aarch64", "riscv64"]'
os_list: '["ubuntu-22.04", "windows-2019"]'

jobs:
Expand All @@ -41,30 +45,119 @@ jobs:
target_list: ${{ steps.step1.outputs.target_list }}
os_list: ${{ steps.step1.outputs.os_list }}
steps:
- uses: actions/checkout@v3
- 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"
# 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:
arch: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
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: 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
- name: mv llvm native
if: ${{ matrix.target }} != "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"
run: mv llvm_install llvm_install_native

# 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: 19
llvm_build_type: RelAssert
# For now target and arch match
arch: ${{ matrix.target }}
save: ${{ inputs.update_cache }}
toolchain_file: scripts/../platform/arm-linux/${{ matrix.target }}-toolchain.cmake"

- name: build ock x86
if: ${{ matrix.target == 'x86_64' && matrix.os == 'ubuntu-22.04' }}
# 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 != 'x86_64' && matrix.os == 'ubuntu-22.04' }}
uses: ./.github/actions/do_build_ock
with:
build_target: install
# Todo : target does not directly equate to arch here
arch: ${{ matrix.target }}
toolchain_file: "platform/arm-linux/aarch64-toolchain.cmake"
extra_flags: -DCA_BUILTINS_TOOLS_DIR=${{ github.workspace }}/llvm_install_native/bin
host_fp16: ON

- 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: Build ock (pretend)
# if: ${{ contains(inputs.target_linux.matrix.arch, matrix.arch) }}
run:
echo Running for ${{ matrix.arch }} on os ${{ matrix.os}} input is ${{ inputs.target_linux }})
- 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
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/planned_testing_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ on:

jobs:
run-with-pull:
name: Call PR testing on pull request
name: _
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/planned_testing.yml
with:
target_list: '["x86_64"]'
# target_list: '["x86_64", "aarch64", "riscv64"]'
target_list: '["aarch64"]'
# os_list: '["ubuntu-22.04", "windows-2019"]'
# target_list: '["x86_64"]'
os_list: '["ubuntu-22.04"]'
# os_list: '["ubuntu-22.04"]'
# target_host_aarch64_linux: true

# # Could have multiple here
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/run_pr_tests_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ on:
- cron: '00 19 * * 1-5'

jobs:
run-with-pull:
name: Call PR testing on pull request
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/run_pr_tests.yml
with:
update_cache: false
# run-with-pull:
# name: Call PR testing on pull request
# if: ${{ github.event_name == 'pull_request' }}
# uses: ./.github/workflows/run_pr_tests.yml
# with:
# update_cache: false

# Could have multiple here
run-with-cron:
name: Call PR testing on schedule
if: ${{ github.event_name == 'schedule' }}
uses: ./.github/workflows/run_pr_tests.yml
with:
update_cache: true
# # Could have multiple here
# run-with-cron:
# name: Call PR testing on schedule
# if: ${{ github.event_name == 'schedule' }}
# uses: ./.github/workflows/run_pr_tests.yml
# with:
# update_cache: true

# additional ones here for cron and/or push to main - also can be in different file.

0 comments on commit ec4aaec

Please sign in to comment.