-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (120 loc) · 4.05 KB
/
build-and-test.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
# 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: IREE Runtime Template
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
build_and_test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-20.04 - clang
os: ubuntu-20.04
cc_compiler: clang
cxx_compiler: clang++
- name: ubuntu-22.04 - clang
os: ubuntu-22.04
cc_compiler: clang
cxx_compiler: clang++
- name: ubuntu-20.04 - gcc
os: ubuntu-20.04
cc_compiler: gcc
cxx_compiler: g++
- name: ubuntu-22.04 - gcc
os: ubuntu-22.04
cc_compiler: gcc
cxx_compiler: g++
- name: windows-2019 - msvc
os: windows-2019
compiler: msvc
- name: windows-2022 - msvc
os: windows-2022
compiler: msvc
- name: windows-2019 - clang
os: windows-2019
compiler: clang
- name: windows-2022 - clang
os: windows-2022
compiler: clang
- name: windows-2019 - gcc
os: windows-2019
compiler: gcc
- name: windows-2022 - gcc
os: windows-2022
compiler: gcc
defaults:
run:
shell: bash
steps:
###########################################################################
# OS specific setup
###########################################################################
- name: Install dependencies (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install cmake clang ninja-build
export CC=${{ matrix.cc_compiler }}
export CXX=${{ matrix.cxx_compiler }}
- name: Configure MSVC (Windows)
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'msvc')
uses: ilammy/[email protected]
- name: Configure clang (Windows)
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'clang')
run: |
choco install ninja --yes
echo "CC='C:\Program Files\LLVM\bin\clang.exe'" >> $GITHUB_ENV
echo "CXX='C:\Program Files\LLVM\bin\clang++.exe'" >> $GITHUB_ENV
- name: Configure GCC (Windows)
if: contains(matrix.os, 'windows') && contains(matrix.compiler, 'gcc')
uses: egor-tensin/setup-mingw@v2
with:
version: 12.2.0
###########################################################################
# General setup
###########################################################################
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install IREE compiler
run: |
python -m pip install iree-compiler
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize submodules
run : |
git \
-c submodule."third_party/llvm-project".update=none \
-c submodule."third_party/stablehlo".update=none \
-c submodule."third_party/torch-mlir".update=none \
submodule update --init --recursive
###########################################################################
# Build and test
###########################################################################
- name: Build sample
run: |
cmake -B build/ -G Ninja
cmake --build build/ --target hello_world
- name: Compile sample module
run: |
iree-compile \
--iree-hal-target-backends=llvm-cpu \
simple_mul.mlir \
-o build/simple_mul.vmfb
- name: Test execution
run: |
./build/hello_world local-sync build/simple_mul.vmfb