Skip to content

Commit 37d6313

Browse files
author
Pavel V Chupin
committed
[CI][NFC] Level up resolve_test_matrix to reusable workflow
* To be reused by top level workflows such as pre-commit or post-commit on both Linux and Windows * Update Windows task name to "Build + LIT" like on Linux
1 parent 558b3ba commit 37d6313

File tree

4 files changed

+62
-44
lines changed

4 files changed

+62
-44
lines changed

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,14 @@ on:
3636
build_artifact_suffix:
3737
type: string
3838
required: true
39-
intel_drivers_image:
40-
type: string
41-
required: false
42-
default: "ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest"
43-
lts_config:
39+
lts:
4440
type: string
4541
required: false
4642
default: ""
4743
lts_cmake_extra_args:
4844
type: string
4945
required: false
5046
default: ""
51-
amdgpu_image:
52-
type: string
53-
required: false
54-
default: "ghcr.io/intel/llvm/ubuntu2004_build:latest"
55-
cuda_image:
56-
type: string
57-
required: false
58-
default: "ghcr.io/intel/llvm/ubuntu2004_build:latest"
5947
lts_ref:
6048
type: string
6149
required: false
@@ -169,38 +157,14 @@ jobs:
169157
name: sycl_lit_${{ inputs.build_artifact_suffix }}
170158
path: lit.tar.xz
171159

172-
# This job generates matrix of tests for LLVM Test Suite
173-
resolve_matrix:
174-
name: Resolve Test Matrix
175-
runs-on: ubuntu-latest
176-
outputs:
177-
lts: ${{ steps.work.outputs.lts }}
178-
steps:
179-
- name: Download scripts and configs
180-
run: |
181-
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/scripts/generate_test_matrix.js
182-
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/test_configs.json
183-
wget raw.githubusercontent.com/intel/llvm/sycl/devops/dependencies.json
184-
mv dependencies.json dependencies.sycl.json
185-
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/dependencies.json
186-
- id: work
187-
uses: actions/github-script@v6
188-
name: Generate matrix
189-
env:
190-
GHA_INPUTS: ${{ toJSON(inputs) }}
191-
with:
192-
script: |
193-
const script = require('./generate_test_matrix.js');
194-
script({core, process});
195-
196160
llvm_test_suite:
197-
needs: [build, resolve_matrix]
198-
if: ${{ inputs.lts_config != '' }}
161+
needs: build
162+
if: ${{ inputs.lts != '' }}
199163
strategy:
200164
fail-fast: false
201165
max-parallel: ${{ inputs.max_parallel }}
202166
matrix:
203-
include: ${{ fromJSON(needs.resolve_matrix.outputs.lts) }}
167+
include: ${{ fromJSON(inputs.lts) }}
204168
name: ${{ matrix.name }}
205169
runs-on: ${{ matrix.runs-on }}
206170
env: ${{ matrix.env }}
@@ -241,4 +205,3 @@ jobs:
241205
check_sycl_all: ${{ matrix.check_sycl_all }}
242206
results_name_suffix: ${{ matrix.config }}_${{ inputs.build_artifact_suffix }}
243207
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
244-

.github/workflows/sycl_precommit.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,23 @@ jobs:
2929
- name: Run clang-format
3030
uses: ./devops/actions/clang-format
3131

32+
# This job generates matrix of tests for LLVM Test Suite
33+
resolve_matrix:
34+
name: Resolve Test Matrix
35+
uses: ./.github/workflows/sycl_resolve_test_matrix.yml
36+
with:
37+
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9;esimd_emu;cuda"
38+
3239
linux_default:
3340
name: Linux
3441
# Only build and test patches, that have passed all linter checks, because
3542
# the next commit is likely to be a follow-up on that job.
36-
needs: lint
43+
needs: [lint, resolve_matrix]
3744
if: always() && (success() || contains(github.event.pull_request.labels.*.name, 'ignore-lint'))
3845
uses: ./.github/workflows/sycl_linux_build_and_test.yml
3946
with:
4047
build_cache_root: "/__w/"
4148
build_cache_size: "8G"
4249
build_artifact_suffix: "default"
4350
build_cache_suffix: "default"
44-
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9;esimd_emu;cuda"
51+
lts: ${{ needs.resolve_matrix.outputs.lts }}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Reusable test matrix generation
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
intel_drivers_image:
7+
type: string
8+
required: false
9+
default: "ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest"
10+
amdgpu_image:
11+
type: string
12+
required: false
13+
default: "ghcr.io/intel/llvm/ubuntu2004_build:latest"
14+
cuda_image:
15+
type: string
16+
required: false
17+
default: "ghcr.io/intel/llvm/ubuntu2004_build:latest"
18+
lts_config:
19+
type: string
20+
required: true
21+
outputs:
22+
lts:
23+
description: "Generated Matrix"
24+
value: ${{ jobs.resolve_matrix.outputs.lts }}
25+
jobs:
26+
resolve_matrix:
27+
name: Resolve Test Matrix
28+
runs-on: ubuntu-latest
29+
outputs:
30+
lts: ${{ steps.work.outputs.lts }}
31+
steps:
32+
- name: Download scripts and configs
33+
shell: bash
34+
run: |
35+
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/scripts/generate_test_matrix.js
36+
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/test_configs.json
37+
wget raw.githubusercontent.com/intel/llvm/sycl/devops/dependencies.json
38+
mv dependencies.json dependencies.sycl.json
39+
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/dependencies.json
40+
- id: work
41+
uses: actions/github-script@v6
42+
name: Generate matrix
43+
env:
44+
GHA_INPUTS: ${{ toJSON(inputs) }}
45+
with:
46+
script: |
47+
const script = require('./generate_test_matrix.js');
48+
script({core, process});

.github/workflows/sycl_windows_build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
build:
13-
name: Build
13+
name: Build + LIT
1414
runs-on: [Windows, build]
1515
# TODO use cached checkout
1616
steps:

0 commit comments

Comments
 (0)