forked from ROCm/TheRock
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (164 loc) · 6.44 KB
/
ci.yml
File metadata and controls
175 lines (164 loc) · 6.44 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
167
168
169
170
171
172
173
174
175
# This CI workflow is triggered by:
# - push to main branch
# - pull request
# - workflow dispatch
#
# For pull requests, we run default builds and tests for:
# - Linux: gfx94X gfx110X
# - Windows: gfx110X
# If you want to trigger jobs for additional targets, please add a defined label (ex: gfx120X-linux) to the pull request
#
# For push to main branch, all AMD families will built and tested from `amdgpu_family_matrix.py`.
#
# Note: If a test machine is not available for a specific AMD GPU family in `amdgpu_family_matrix.py`, tests will be skipped.
name: CI
on:
push:
branches:
- main
- release/therock-*
workflow_dispatch:
inputs:
linux_amdgpu_families:
type: string
description: "Insert comma-separated list of Linux GPU families to build and test. ex: gfx94X, gfx1201X"
default: ""
linux_test_labels:
type: string
description: "If enabled, reduce test set on Linux to the list of labels prefixed with 'test:'. ex: test:rocprim, test:hipcub"
default: ""
linux_use_prebuilt_artifacts:
type: boolean
description: "If enabled, the CI will pull Linux artifacts using artifact_run_id and only run tests"
windows_amdgpu_families:
type: string
description: "Insert comma-separated list of Windows GPU families to build and test. ex: gfx94X, gfx1201X"
default: ""
windows_test_labels:
type: string
description: "If enabled, reduce test set on Windows to the list of labels prefixed with 'test:' ex: test:rocprim, test:hipcub"
default: ""
windows_use_prebuilt_artifacts:
type: boolean
description: "If enabled, the CI will pull Windows artifacts using artifact_run_id and only run tests"
additional_label_options:
type: string
description: "If enabled, these additional labels options will be applied. ex: test_runner:oem"
default: ""
artifact_run_id:
type: string
description: "If provided, the tests will run on this artifact ID"
default: ""
pull_request:
types:
- labeled
- opened
- synchronize
permissions:
contents: read
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit). The workflow name is prepended to avoid conflicts between
# different workflows.
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
setup:
uses: ./.github/workflows/setup.yml
with:
build_variant: "release"
linux_build_and_test:
name: Linux::${{ matrix.variant.family }}::${{ matrix.variant.build_variant_label }}
needs: setup
if: >-
${{
needs.setup.outputs.linux_variants != '[]' &&
needs.setup.outputs.enable_build_jobs == 'true'
}}
strategy:
fail-fast: false
matrix:
variant: ${{ fromJSON(needs.setup.outputs.linux_variants) }}
uses: ./.github/workflows/ci_linux.yml
secrets: inherit
with:
amdgpu_families: ${{ matrix.variant.family }}
artifact_group: ${{ matrix.variant.artifact_group }}
test_runs_on: ${{ matrix.variant.test-runs-on }}
build_variant_label: ${{ matrix.variant.build_variant_label }}
build_variant_suffix: ${{ matrix.variant.build_variant_suffix }}
build_variant_cmake_preset: ${{ matrix.variant.build_variant_cmake_preset }}
test_labels: ${{ needs.setup.outputs.linux_test_labels }}
artifact_run_id: ${{ inputs.artifact_run_id }}
expect_failure: ${{ matrix.variant.expect_failure == true }}
use_prebuilt_artifacts: ${{ inputs.linux_use_prebuilt_artifacts == true && 'true' || 'false' }}
rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }}
test_type: ${{ needs.setup.outputs.test_type }}
sanity_check_only_for_family: ${{ matrix.variant.sanity_check_only_for_family == true }}
permissions:
contents: read
id-token: write
windows_build_and_test:
name: Windows::${{ matrix.variant.family }}::${{ matrix.variant.build_variant_label }}
needs: setup
if: >-
${{
needs.setup.outputs.windows_variants != '[]' &&
needs.setup.outputs.enable_build_jobs == 'true'
}}
strategy:
fail-fast: false
matrix:
variant: ${{ fromJSON(needs.setup.outputs.windows_variants) }}
uses: ./.github/workflows/ci_windows.yml
with:
amdgpu_families: ${{ matrix.variant.family }}
artifact_group: ${{ matrix.variant.artifact_group }}
test_runs_on: ${{ matrix.variant.test-runs-on }}
build_variant_label: ${{ matrix.variant.build_variant_label }}
build_variant_suffix: ${{ matrix.variant.build_variant_suffix }}
build_variant_cmake_preset: ${{ matrix.variant.build_variant_cmake_preset }}
test_labels: ${{ needs.setup.outputs.windows_test_labels }}
artifact_run_id: ${{ inputs.artifact_run_id }}
expect_failure: ${{ matrix.variant.expect_failure == true }}
use_prebuilt_artifacts: ${{ inputs.windows_use_prebuilt_artifacts == true && 'true' || 'false' }}
rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }}
test_type: ${{ needs.setup.outputs.test_type }}
sanity_check_only_for_family: ${{ matrix.variant.sanity_check_only_for_family == true }}
permissions:
contents: read
id-token: write
# build_python_packages:
# name: Build Python Packages
# uses: ./.github/workflows/build_python_packages.yml
ci_summary:
name: CI Summary
if: always()
needs:
- setup
- linux_build_and_test
- windows_build_and_test
runs-on: ubuntu-24.04
steps:
- name: Output failed jobs
run: |
echo '${{ toJson(needs) }}'
# Build a list of failed jobs, but ignore those marked continue-on-error
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
| jq --raw-output '
to_entries
| map(select(
(.value.result != "success" and .value.result != "skipped")
and (.value.outputs.continue_on_error | not)
))
| map(.key)
| join(",")
' \
)"
if [[ -n "${FAILED_JOBS}" ]]; then
echo "The following jobs failed: ${FAILED_JOBS}"
exit 1
else
echo "All required jobs succeeded (continue-on-error jobs ignored)."
fi