-
Notifications
You must be signed in to change notification settings - Fork 630
212 lines (200 loc) · 7.65 KB
/
ci.yml
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# Copyright 2022 The IREE 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: CI
# A few notes:
#
# Variables:
# GitHub actions don't have variables or even support normal yaml anchors (they
# are specially disabled because...reasons?):
# See https://github.com/github-community/community/discussions/4501
# https://github.community/t/support-for-yaml-anchors/16128/92
# https://github.com/actions/runner/issues/1182
# Neither does it have any contexts that are available everywhere. The
# top-level `env` field is available in many places, but not all. We already
# have a "setup" job that every other job depends on, so we leverage that
# for variables that every other job can use, since that *is* available in all
# sub-fields of the job.
# See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
# and https://github.com/community/community/discussions/27370
#
# Runner label ordering:
# - self-hosted always has to be listed first in a runs-on block:
# https://docs.github.com/en/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
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 are organized into groups and topologically sorted by dependencies
jobs:
setup:
uses: ./.github/workflows/setup.yml
runtime:
needs: setup
name: "runtime :: ${{ matrix.name }}"
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'runtime')
runs-on: ${{ matrix.runs-on }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-24.04
runs-on: ubuntu-24.04
driver-options: -DIREE_HAL_DRIVER_CUDA=ON -DIREE_HAL_DRIVER_HIP=ON -DIREE_HAL_DRIVER_VULKAN=ON
- name: windows-2022
runs-on: windows-2022
driver-options: -DIREE_HAL_DRIVER_CUDA=ON -DIREE_HAL_DRIVER_HIP=ON -DIREE_HAL_DRIVER_VULKAN=ON
- name: macos-14
runs-on: macos-14
driver-options: -DIREE_HAL_DRIVER_METAL=ON -DIREE_HAL_DRIVER_VULKAN=OFF
env:
BUILD_DIR: build-runtime
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.11"
- name: (Linux) Install requirements
if: contains(matrix.name, 'ubuntu')
run: |
sudo apt update
sudo apt install -y ninja-build
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: (Windows) Configure MSVC
if: contains(matrix.name, 'windows')
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: (macOS) Install requirements
if: contains(matrix.name, 'macos')
run: brew install ninja ccache coreutils bash
- name: Checkout runtime submodules
run: bash ./build_tools/scripts/git/update_runtime_submodules.sh
- name: Install Python requirements
run: pip install -r ./runtime/bindings/python/iree/runtime/build_requirements.txt
- name: ccache
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: ${{ github.job }}-${{ matrix.name }}
save: ${{ needs.setup.outputs.write-caches == 1 }}
- name: CMake - configure
run: |
cmake \
-G Ninja \
-B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIREE_BUILD_COMPILER=OFF \
-DIREE_BUILD_PYTHON_BINDINGS=ON \
-DIREE_BUILD_SAMPLES=ON \
-DIREE_ENABLE_LLD=ON \
-DIREE_ENABLE_ASSERTIONS=ON \
${{matrix.driver-options}}
- name: CMake - build
run: cmake --build ${BUILD_DIR} -- -k 0
- name: CTest
run: bash ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
runtime_small:
needs: setup
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'runtime_small')
runs-on: ubuntu-24.04
env:
BUILD_DIR: build-runtime
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install requirements
run: sudo apt update && sudo apt install -y ninja-build
- name: Checkout runtime submodules
run: bash ./build_tools/scripts/git/update_runtime_submodules.sh
- name: ccache
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: ${{ github.job }}
save: ${{ needs.setup.outputs.write-caches == 1 }}
- name: CMake - configure
run: |
cmake \
-G Ninja \
-B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIREE_BUILD_COMPILER=OFF \
-DIREE_RUNTIME_OPTIMIZATION_PROFILE=size \
-DIREE_ENABLE_LLD=ON
- name: CMake - build
run: cmake --build ${BUILD_DIR} -- -k 0
- name: CTest
run: bash ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
runtime_tracing:
needs: setup
name: "runtime_tracing :: ${{ matrix.provider }} provider"
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'runtime_tracing')
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- provider: tracy
- provider: console
env:
BUILD_DIR: build-tracing
CC: clang
CXX: clang++
TRACING_PROVIDER: ${{ matrix.provider }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install requirements
run: sudo apt update && sudo apt install -y ninja-build
- name: Checkout runtime submodules
run: bash ./build_tools/scripts/git/update_runtime_submodules.sh
- name: ccache
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: ${{ github.job }}-${{ matrix.provider }}
save: ${{ needs.setup.outputs.write-caches == 1 }}
- name: CMake - configure
run: |
cmake \
-G Ninja \
-B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIREE_BUILD_COMPILER=OFF \
-DIREE_ENABLE_LLD=ON \
-DIREE_ENABLE_RUNTIME_TRACING=ON \
-DIREE_TRACING_PROVIDER=${TRACING_PROVIDER} \
-DIREE_HAL_DRIVER_CUDA=ON \
-DIREE_HAL_DRIVER_HIP=ON
- name: CMake - build
run: cmake --build ${BUILD_DIR} -- -k 0
##############################################################################
# Aggregate job status and alerting on failures.
ci_summary:
if: always()
needs:
- setup
- runtime
- runtime_small
- runtime_tracing
uses: ./.github/workflows/workflow_summary.yml
secrets: inherit
with:
jobs-json: ${{ toJson(needs) }}