From 0bebbea6bd2a1dc8a60f6062a7b9e3e62c86b921 Mon Sep 17 00:00:00 2001 From: Weronika Lewandowska Date: Thu, 18 Jan 2024 15:41:42 +0100 Subject: [PATCH] [CI] Enable Cuda test-e2e per PR --- .../{e2e_nightly.yml => e2e_core.yml} | 63 ++++++++++++++++--- .github/workflows/e2e_cuda.yml | 28 +++++++++ .github/workflows/e2e_opencl.yml | 28 +++++++++ 3 files changed, 112 insertions(+), 7 deletions(-) rename .github/workflows/{e2e_nightly.yml => e2e_core.yml} (68%) create mode 100644 .github/workflows/e2e_cuda.yml create mode 100644 .github/workflows/e2e_opencl.yml diff --git a/.github/workflows/e2e_nightly.yml b/.github/workflows/e2e_core.yml similarity index 68% rename from .github/workflows/e2e_nightly.yml rename to .github/workflows/e2e_core.yml index a1807a3682..390086749b 100644 --- a/.github/workflows/e2e_nightly.yml +++ b/.github/workflows/e2e_core.yml @@ -1,12 +1,39 @@ -name: E2E Nightly +name: E2E build & run on: - schedule: - # Run every day at 23:00 UTC - - cron: '0 23 * * *' + # this workflow can by only triggered by other workflows + # for example by: e2e_cuda.yml or e2e_opencl.yml + workflow_call: + # acceptable input from adapter-specific workflows + inputs: + name: + description: Adapter name + type: string + required: true + str_name: Formatted adapter name + description: + type: string + required: true + prefix: + description: Prefix for cmake parameter + type: string + required: true + config: + description: Params for sycl configuration + type: string + required: true + unit: + description: Test unit (cpu/gpu) + type: string + required: true + runner_tag: + description: Tag defifned for the runner + type: string + required: true permissions: contents: read + pull-requests: write jobs: e2e-build-hw: @@ -14,13 +41,16 @@ jobs: strategy: matrix: adapter: [ - {name: CUDA, str_name: cuda, prefix: "ext_oneapi_", config: "--cuda --hip", unit: "gpu"}, - {name: OPENCL, str_name: opencl, prefix: "", config: "", unit: "cpu"} + {name: "${{inputs.name}}", + str_name: "${{inputs.str_name}}", + prefix: "${{inputs.prefix}}", + config: "${{inputs.config}}", + unit: "${{inputs.unit}}"} ] build_type: [Release] compiler: [{c: clang, cxx: clang++}] - runs-on: ${{matrix.adapter.name}} + runs-on: ${{inputs.runner_tag}} steps: # Workspace on self-hosted runners is not cleaned automatically. @@ -31,6 +61,25 @@ jobs: ls -la ./ rm -rf ./* || true + - uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v2.0.0 + id: comment-branch + + - name: Add comment to PR + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + if: always() + with: + script: | + const adapter = '${{ matrix.adapter.name }}'; + const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; + const body = `E2E ${adapter} build: \n${url}`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body + }) + - name: Checkout UR uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: diff --git a/.github/workflows/e2e_cuda.yml b/.github/workflows/e2e_cuda.yml new file mode 100644 index 0000000000..09d8c71539 --- /dev/null +++ b/.github/workflows/e2e_cuda.yml @@ -0,0 +1,28 @@ +name: E2E Cuda + +on: + schedule: + # Run every day at 23:00 UTC + - cron: '0 23 * * *' + issue_comment: + types: [created, edited] + +permissions: + contents: read + pull-requests: write + +jobs: + e2e-build-hw: + # trigger only if PR comment contains "e2e-cuda" + if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/e2e-cuda')) || (github.event_name == 'schedule') }} + name: Start e2e job + # use core flow, run it with cuda specific parameters + uses: ./.github/workflows/e2e_core.yml + # parameters that we pass to the core flow + with: + name: "CUDA" + runner_tag: "CUDA_E2E" + str_name: "cuda" + prefix: "ext_oneapi_" + config: "--cuda" + unit: "gpu" diff --git a/.github/workflows/e2e_opencl.yml b/.github/workflows/e2e_opencl.yml new file mode 100644 index 0000000000..54c04845e2 --- /dev/null +++ b/.github/workflows/e2e_opencl.yml @@ -0,0 +1,28 @@ +name: E2E OpenCL + +on: + schedule: + # Run every day at 23:00 UTC + - cron: '0 23 * * *' + issue_comment: + types: [created, edited] + +permissions: + contents: read + pull-requests: write + +jobs: + e2e-build-hw: + # trigger only if PR comment contains "e2e-opencl" + if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/e2e-opencl')) || (github.event_name == 'schedule') }} + name: Start e2e job + # use core flow, run it with OpenCL specific parameters + uses: ./.github/workflows/e2e_core.yml + # parameters that we pass to the core flow + with: + name: "OPENCL" + runner_tag: "OPENCL" + str_name: "opencl" + prefix: "" + config: "" + unit: "cpu"