Repository navigation
166 lines (154 loc) · 6.01 KB
/
Copy pathtest_core_linux_gpu.yml
File metadata and controls
166 lines (154 loc) · 6.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Copyright 2026 The HRX Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Test CMake Linux GPU
on:
workflow_call:
inputs:
name:
type: string
default: Linux / CMake / GPU gfx942
runner_labels:
type: string
description: "JSON array of labels that must all match the GPU runner."
required: true
artifact_run_id:
type: string
default: ""
device:
type: string
default: gpu:0
ctest_regex:
type: string
default: ""
ctest_exclude_regex:
type: string
default: ""
ctest_label_regex:
type: string
default: runtime-resource=amd-gpu
ctest_label_exclude_regex:
type: string
default: ""
ctest_parallelism:
type: number
default: 1
experimental:
type: boolean
default: false
workflow_dispatch:
inputs:
artifact_run_id:
type: string
description: "GitHub Actions run id containing HRX package artifacts. Empty means this workflow run."
default: ""
runner_labels:
type: string
description: "JSON array of labels that must all match the GPU runner."
required: true
device:
type: string
description: "libhrx CTS device spec."
default: gpu:0
ctest_regex:
type: string
description: "Optional CTest name regex for installed GPU tests."
default: ""
ctest_exclude_regex:
type: string
description: "Optional CTest name exclusion regex for installed GPU tests."
default: ""
ctest_label_regex:
type: string
description: "CTest label regex for GPU installed tests."
default: runtime-resource=amd-gpu
ctest_label_exclude_regex:
type: string
description: "CTest label exclusion regex."
default: ""
ctest_parallelism:
type: number
description: "CTest parallelism on the GPU runner."
default: 1
experimental:
type: boolean
description: "Allow installed GPU tests to fail without failing the workflow."
default: false
permissions:
actions: read
contents: read
jobs:
test_core_linux_gpu:
name: ${{ inputs.name || 'Linux / CMake / GPU gfx942' }}
runs-on: ${{ fromJSON(inputs.runner_labels) }}
timeout-minutes: 20
env:
HRX_OUTPUT_DIR: ${{ github.workspace }}/build/linux-gpu
HRX_ARTIFACT_DOWNLOAD_DIR: ${{ github.workspace }}/build/linux-gpu/artifacts
HRX_PUBLIC_INSTALL_DIR: ${{ github.workspace }}/build/linux-gpu/install/public
HRX_PUBLIC_DEPS_DIR: ${{ github.workspace }}/build/linux-gpu/install/public-deps
HRX_TESTS_INSTALL_DIR: ${{ github.workspace }}/build/linux-gpu/install/tests
HRX_COMPOSED_INSTALL_DIR: ${{ github.workspace }}/build/linux-gpu/install/composed
HRX_PREPARE_PUBLIC_DEPS: "false"
HRX_PACKAGE_SMOKE: "false"
HRX_TEST_GPU: "true"
HRX_CTS_DEVICE: ${{ inputs.device || 'gpu:0' }}
HRX_CTEST_REGEX: ${{ inputs.ctest_regex }}
HRX_CTEST_EXCLUDE_REGEX: ${{ inputs.ctest_exclude_regex }}
HRX_CTEST_LABEL_REGEX: ${{ inputs.ctest_label_regex }}
HRX_CTEST_LABEL_EXCLUDE_REGEX: ${{ inputs.ctest_label_exclude_regex }}
HRX_CTEST_PARALLELISM: ${{ inputs.ctest_parallelism || 1 }}
HRX_TEST_TMPDIR: ${{ github.workspace }}/build/linux-gpu/test-tmp
HRX_PYTHON: ${{ github.workspace }}/build/linux-gpu/python/bin/python3
PIP_CACHE_DIR: ${{ github.workspace }}/build/linux-gpu/caches/pip
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Adjust git config
run: git config --global --add safe.directory "$PWD"
- name: Install Python dependencies
run: |
python3 --version
mkdir -p "${HRX_OUTPUT_DIR}"
python3 -m venv "${HRX_OUTPUT_DIR}/python"
"${HRX_PYTHON}" -m pip install --upgrade pip cmake==3.31.6 zstandard
echo "${HRX_OUTPUT_DIR}/python/bin" >> "${GITHUB_PATH}"
"${HRX_OUTPUT_DIR}/python/bin/ctest" --version
- name: Download public package artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: hrx-public-linux-x86_64
path: ${{ env.HRX_ARTIFACT_DOWNLOAD_DIR }}
run-id: ${{ inputs.artifact_run_id || github.run_id }}
github-token: ${{ github.token }}
- name: Download public dependency package artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: hrx-public-deps-linux-x86_64
path: ${{ env.HRX_ARTIFACT_DOWNLOAD_DIR }}
run-id: ${{ inputs.artifact_run_id || github.run_id }}
github-token: ${{ github.token }}
- name: Download test package artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: hrx-tests-linux-x86_64
path: ${{ env.HRX_ARTIFACT_DOWNLOAD_DIR }}
run-id: ${{ inputs.artifact_run_id || github.run_id }}
github-token: ${{ github.token }}
- name: Extract package artifacts
run: |
"${HRX_PYTHON}" build_tools/ci_core_linux.py extract-packages
- name: Report ROCm environment
id: rocm_environment
continue-on-error: ${{ inputs.experimental }}
run: |
export PATH="${HRX_PUBLIC_DEPS_DIR}/bin:${PATH}"
export LD_LIBRARY_PATH="${HRX_PUBLIC_DEPS_DIR}/lib:${HRX_PUBLIC_DEPS_DIR}/lib/rocm_sysdeps/lib:${LD_LIBRARY_PATH:-}"
bash .github/scripts/check_rocm_environment.sh
- name: Run installed GPU tests
if: ${{ steps.rocm_environment.outcome == 'success' }}
continue-on-error: ${{ inputs.experimental }}
run: |
"${HRX_PYTHON}" build_tools/ci_core_linux.py test