diff --git a/.github/actions/do_build_ock/action.yml b/.github/actions/do_build_ock/action.yml index 6b5a217b69..aaa3d44fbd 100644 --- a/.github/actions/do_build_ock/action.yml +++ b/.github/actions/do_build_ock/action.yml @@ -103,12 +103,9 @@ inputs: shell_to_use: description: "which shell to use (default bash)" default: bash - c_compiler: - description: "C compiler (default gcc)" - default: "gcc" - 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 @@ -164,8 +161,7 @@ runs: -DCA_CL_DISABLE_UNITCL_VECZ_CHECKS=${{ inputs.disable_unitcl_vecz_checks }} -DCA_GTEST_LAUNCHER="${{ inputs.gtest_launcher }}" -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 diff --git a/.github/actions/setup_build/action.yml b/.github/actions/setup_build/action.yml index 87afbdbe10..5f0d060bd2 100644 --- a/.github/actions/setup_build/action.yml +++ b/.github/actions/setup_build/action.yml @@ -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 diff --git a/.github/workflows/planned_testing.yml b/.github/workflows/planned_testing.yml index f90d57a19e..d939265163 100644 --- a/.github/workflows/planned_testing.yml +++ b/.github/workflows/planned_testing.yml @@ -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 @@ -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: @@ -41,30 +45,127 @@ 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' }} + uses: ./.github/actions/do_build_ock + with: + build_targets: install + offline_kernel_tests: OFF + install_dir: install_ock_${{matrix.os}}_${{matrix.target}} + + - name: build ock other ${{ matrix.target }} + if: ${{ matrix.target != 'x86_64' }} + uses: ./.github/actions/do_build_ock + with: + build_targets: 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 + # Do we need the offline kernel as an artefact? If so currently this requires an external clc or qemu to be installed. + offline_kernel_tests: OFF + install_dir: install_ock_${{matrix.os}}_${{matrix.target}} + host_fp16: ON + + # Prune it as there is too much things in there we don't want to use + # We may want to extend this a bit as time goes on such as clc or UnitCL + - name: prune ock artefact ${{ matrix.target }} + run: | + # delete all but city runner and the python associated file under bin + find install_ock_${{matrix.os}}_${{matrix.target}}/bin -maxdepth 0 -type f ! -name "*.py" -delete + rm install_ock_${{matrix.os}}_${{matrix.target}}/share + + - name: upload ock artefact + uses: actions/upload-artifact@v4 + with: + name: ock_${{matrix.os}}_${{matrix.target}} + path: install_ock_${{matrix.os}}_${{matrix.target}} + 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: + 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 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 + uses: actions/download-artifact@v4 + with: + name: ock_${{matrix.os}}_${{matrix.target}} + - name: print ock artefact + run: | + ls -R . # echo "${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.arch }}" > foo.txt # --define CA_CL_ENABLE_ICD_LOADER=ON diff --git a/.github/workflows/planned_testing_caller.yml b/.github/workflows/planned_testing_caller.yml index 844cda43aa..f3d8e5d908 100644 --- a/.github/workflows/planned_testing_caller.yml +++ b/.github/workflows/planned_testing_caller.yml @@ -10,12 +10,17 @@ on: jobs: run-with-pull: - name: Call PR testing on pull request + # This makes the diagram too big if we post much here so P_ for pull request. + name: P_ 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: '["x86_64", "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 diff --git a/.github/workflows/run_pr_tests_caller.yml b/.github/workflows/run_pr_tests_caller.yml index a40a2951f9..7ae5214ba6 100644 --- a/.github/workflows/run_pr_tests_caller.yml +++ b/.github/workflows/run_pr_tests_caller.yml @@ -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.