diff --git a/.github/actions/do_build_ock_artefact/action.yml b/.github/actions/do_build_ock_artefact/action.yml index 2c7f128a9..ca7823b84 100644 --- a/.github/actions/do_build_ock_artefact/action.yml +++ b/.github/actions/do_build_ock_artefact/action.yml @@ -9,6 +9,9 @@ inputs: default: '19' target: description: 'target architecture' + create_ock_artefact_method: + description: 'method of creating ock artefact - build,' + default: "build" # TODO: This has not been tested yet on windows so would likely need some updating. runs: @@ -29,13 +32,14 @@ runs: # installs tools, ninja, installs llvm and sets up sccache - name: setup uses: ./.github/actions/setup_build + if: inputs.create_ock_artefact_method == 'build' with: llvm_version: ${{ inputs.llvm_version }} llvm_build_type: RelAssert cross_arch: ${{ steps.calc_vars.outputs.arch == 'x86_64' && 'none' || steps.calc_vars.outputs.arch }} - name: build ock x86 - if: steps.calc_vars.outputs.arch == 'x86_64' + if: steps.calc_vars.outputs.arch == 'x86_64' && inputs.create_ock_artefact_method == 'build' uses: ./.github/actions/do_build_ock with: build_targets: install @@ -43,7 +47,7 @@ runs: extra_flags: -DCA_ENABLE_TESTS=OFF -DCA_ENABLE_EXAMPLES=OFF -DCA_ENABLE_DOCUMENTATION=OFF - name: build ock other ${{ matrix.target }} - if: steps.calc_vars.outputs.arch != 'x86_64' + if: steps.calc_vars.outputs.arch != 'x86_64' && inputs.create_ock_artefact_method == 'build' uses: ./.github/actions/do_build_ock with: build_targets: install @@ -53,6 +57,13 @@ runs: offline_kernel_tests: OFF host_fp16: ON + - name: download previous ock if needed ${{ matrix.target }} ${{ matrix.create_ock_artefact_method}} + shell: bash + if: inputs.create_ock_artefact_method != 'build' + run: | + gh run download ${{ inputs.create_ock_artefact_method }} -n ock_${{ inputs.target }} -D install + ls install + # Prune it as there is too much things in there we don't want to use # Todo: move this logic to cmake settings so that we build only what we # want to install. As time goes on we may want to install more. diff --git a/.github/actions/do_build_opencl_cts/action.yml b/.github/actions/do_build_opencl_cts/action.yml index bae51173d..d4668f3c2 100644 --- a/.github/actions/do_build_opencl_cts/action.yml +++ b/.github/actions/do_build_opencl_cts/action.yml @@ -4,38 +4,47 @@ description: build opencl cts inputs: target: description: 'target architecture' - + create_opencl_cts_artefact_method: + description: 'method of creating ock artefact - build,' + default: "build" runs: using: "composite" steps: - name: calc vars + if: inputs.create_opencl_cts_artefact_method == 'build' id: calc_vars uses: ./.github/actions/calc_vars with: target: ${{ inputs.target }} - name: Install Ninja + if: inputs.create_opencl_cts_artefact_method == 'build' uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main branch - name: download icd artifact + # Currently need to do the even if we are installing as build and run have + # not been separated into different jobs uses: actions/download-artifact@v4 with: name: icd_${{inputs.target}} path: install_icd - name: download header artifact + if: inputs.create_opencl_cts_artefact_method == 'build' uses: actions/download-artifact@v4 with: name: header_${{inputs.target}} path: install_headers - name: checkout test suite + if: inputs.create_opencl_cts_artefact_method == 'build' uses: actions/checkout@v4 with: repository: KhronosGroup/OpenCL-CTS path: OpenCL-CTS - name: build opencl cts + if: inputs.create_opencl_cts_artefact_method == 'build' shell: bash env: # TODO: host-x86_64-linux 'toolchain' - expand for other targets @@ -63,6 +72,15 @@ runs: --source-dir $GITHUB_WORKSPACE/OpenCL-CTS/test_conformance/spirv_new/spirv_asm \ --output-dir $GITHUB_WORKSPACE/test_conformance/spirv_bin + - name: download previous opencl_cts if needed ${{ matrix.target }} ${{ matrix.create_ock_artefact_method}} + shell: bash + if: inputs.create_opencl_cts_artefact_method != 'build' + run: | + gh run download ${{ inputs.create_opencl_cts_artefact_method }} -n opencl_cts_${{ inputs.target }} -D test_conformance + pwd + echo ls $PWD/test_conformance + ls test_conformance + - name: upload opencl cts artifacts uses: actions/upload-artifact@v4 with: @@ -77,5 +95,5 @@ runs: !test_conformance/**/*.ninja !test_conformance/test_common !test_conformance/test_common/** - retention-days: 1 + retention-days: 2 diff --git a/.github/actions/run_opencl_cts/action.yml b/.github/actions/run_opencl_cts/action.yml index 975a67586..91789bd15 100644 --- a/.github/actions/run_opencl_cts/action.yml +++ b/.github/actions/run_opencl_cts/action.yml @@ -23,19 +23,40 @@ runs: shell: bash env: CTS_CSV_FILE: opencl_conformance_tests_${{inputs.test_type}}.csv - # TODO: host-x86_64-linux filter - expand for other targets - CTS_FILTER: cts-3.0-online-ignore-linux-host.csv - CTS_TIMEOUT: 18:00:00 # OK for github? + CTS_FILTER: cts-3.0-online-ignore-linux-host.csv + run: | - cd "$GITHUB_WORKSPACE/OpenCL-CTS" - echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER" set -x + pwd + echo ls $PWD/test_conformance + # Todo: always download artefact and ensure artefacts are stored with permissions using an action that uses tar + chmod +x test_conformance/*/* + echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER" + echo > expect_fail.csv + # $CTS_FILTER ignores certain test, so is treated differently to temporary fails. + [ -f .github/opencl_cts/expect_fail_all.csv ] && cat .github/opencl_cts/expect_fail_all.csv >> expect_fail.csv + [ -f .github/opencl_cts/expect_fail_${{ inputs.target }}.csv ] && cat .github/opencl_cts/expect_fail_${{ inputs.target }}.csv >> expect_fail.csv + cat expect_fail.csv "$GITHUB_WORKSPACE/source/cl/scripts/$CTS_FILTER" > disable.csv python -u "$GITHUB_WORKSPACE/scripts/testing/run_cities.py" -v \ - --color=always --timeout $CTS_TIMEOUT \ + --color=always --timeout 05:00:00 \ -b "$GITHUB_WORKSPACE/test_conformance" \ -L "$GITHUB_WORKSPACE/install_icd/lib" \ -e "CLC_EXECUTABLE=$GITHUB_WORKSPACE/install_ock/bin/clc" \ -e "OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so" \ -e "CL_PLATFORM_INDEX=0" \ -s "$GITHUB_WORKSPACE/test_conformance/$CTS_CSV_FILE" \ - -i "$GITHUB_WORKSPACE/source/cl/scripts/$CTS_FILTER" + -i disable.csv + + - name: Run expected failed opencl cts + shell: bash + run: | + echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER" + set -x + python -u "$GITHUB_WORKSPACE/scripts/testing/run_cities.py" -v \ + --color=always --timeout 05:00:00 \ + -b "$GITHUB_WORKSPACE/test_conformance" \ + -L "$GITHUB_WORKSPACE/install_icd/lib" \ + -e "CLC_EXECUTABLE=$GITHUB_WORKSPACE/install_ock/bin/clc" \ + -e "OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so" \ + -e "CL_PLATFORM_INDEX=0" \ + -s expect_fail.csv || echo failed as expected diff --git a/.github/opencl_cts/expect_fail_all.csv b/.github/opencl_cts/expect_fail_all.csv new file mode 100644 index 000000000..b2098fddd --- /dev/null +++ b/.github/opencl_cts/expect_fail_all.csv @@ -0,0 +1 @@ +API,api/test_api diff --git a/.github/workflows/planned_testing.yml b/.github/workflows/planned_testing.yml index cc2c6737e..55298fb8f 100644 --- a/.github/workflows/planned_testing.yml +++ b/.github/workflows/planned_testing.yml @@ -26,6 +26,16 @@ on: required: false type: boolean default: false + create_ock_artefact_method: + # How to create the ock artefact build or workflow id + required: false + type: string + default: "build" + create_opencl_cts_artefact_method: + # How to create the ock opencl cts build or workflow id + required: false + type: string + default: "build" jobs: @@ -62,11 +72,20 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + - name: set up secret ubuntu + if: startsWith(runner.os, 'Windows') != true + run: + echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: set up secret windows + if: startsWith(runner.os, 'Windows') + run: + echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $env:GITHUB_ENV - name: build ock artefact uses: ./.github/actions/do_build_ock_artefact with: target: ${{ matrix.target }} llvm_version: ${{ inputs.llvm_version }} + create_ock_artefact_method: ${{ inputs.create_ock_artefact_method }} build_icd: if: inputs.test_tornado || inputs.test_opencl_cts @@ -139,13 +158,16 @@ jobs: scripts source .github + - name: set up secret ubuntu + run: + echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV # TODO: Consider separating out opencl_cts build and run in the future - name : build and upload opencl_cts uses: ./.github/actions/do_build_opencl_cts with: target: ${{ matrix.target }} + create_opencl_cts_artefact_method: ${{ inputs.create_opencl_cts_artefact_method }} - name : run opencl_cts uses: ./.github/actions/run_opencl_cts with: target: ${{ matrix.target }} - diff --git a/.github/workflows/planned_testing_caller.yml b/.github/workflows/planned_testing_caller.yml index 267b5c5fd..19983e6e2 100644 --- a/.github/workflows/planned_testing_caller.yml +++ b/.github/workflows/planned_testing_caller.yml @@ -18,9 +18,13 @@ jobs: if: github.repository == 'uxlfoundation/oneapi-construction-kit' || github.event_name != 'schedule' uses: ./.github/workflows/planned_testing.yml with: - target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]' - test_tornado: true + # target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]' + target_list: '["host_x86_64_linux"]' + # test_tornado: true + test_tornado: false test_opencl_cts: true # Have a pull request setting which can be used to test the flow as best as possible # in a reasonable time + create_ock_artefact_method: 12300776706 + create_opencl_cts_artefact_method: 12300776706 pull_request: ${{ github.event_name == 'pull_request' }}