forked from Xilinx/mlir-aie
-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (140 loc) · 4.98 KB
/
Copy pathbuildAndTestMulti.yml
File metadata and controls
162 lines (140 loc) · 4.98 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
name: Compile across platforms
on:
push:
branches:
- main
pull_request:
types: [assigned, opened, synchronize, reopened]
workflow_dispatch:
merge_group:
schedule:
# Runs at midnight (00:00) every day
- cron: '0 0 * * *'
defaults:
run:
# force bash for windows
shell: bash
env:
# Run apt package manager in the CI in non-interactive mode.
# Otherwise, on Ubuntu 20.04 the installation of tzdata asking question
DEBIAN_FRONTEND: noninteractive
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).
group: ci-build-test-multi-cpp-linux-${{ github.event.number || github.sha }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build-repo:
name: ${{ matrix.OS }} ${{ matrix.COMPILER }} assert=${{ matrix.ENABLE_ASSERTIONS }} rtti=${{ matrix.ENABLE_RTTI }}
runs-on: ${{ matrix.OS }}
strategy:
# Run all the test even if there are some which fail
fail-fast: false
# Run the tests on the Cartesian product of the following
matrix:
OS: [ ubuntu-22.04, ubuntu-24.04 ]
COMPILER: [ llvm, gcc ]
ENABLE_ASSERTIONS: [ ON, OFF ]
ENABLE_RTTI: [ ON, OFF ]
include:
- OS: windows-2022
COMPILER: msvc
ENABLE_ASSERTIONS: ON
ENABLE_RTTI: ON
- OS: windows-2022
COMPILER: msvc
ENABLE_ASSERTIONS: ON
ENABLE_RTTI: OFF
- OS: windows-2022
COMPILER: msvc
ENABLE_ASSERTIONS: OFF
ENABLE_RTTI: ON
- OS: windows-2022
COMPILER: msvc
ENABLE_ASSERTIONS: OFF
ENABLE_RTTI: OFF
steps:
# Clone the repo and its submodules. Do shallow clone to save clone
# time.
- name: Get the project repository
uses: actions/checkout@v6
with:
fetch-depth: 2
submodules: "true"
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python packages
run: |
python -m pip install --upgrade pip
python utils/mlir_aie_wheels/vendor_eudsl.py \
--requirements python/requirements.txt \
--install-non-eudsl
pip install -r python/requirements_notebook.txt
pip install -r python/requirements_dev.txt
- name: Setup Cpp
uses: aminya/setup-cpp@1fd813945e55021261b381c59275db442da4082f
with:
compiler: ${{ matrix.COMPILER }}
vcvarsall: ${{ contains(matrix.OS, 'windows') }}
cmake: true
ninja: true
cppcheck: false
clangtidy: false
clangformat: false
- uses: ./.github/actions/setup_ccache
id: setup_ccache
with:
MATRIX_OS: ${{ matrix.OS }}
MATRIX_ARCH: x86
EXTRA_KEY: compile-and-test-assert=${{ matrix.ENABLE_ASSERTIONS }}-rtti=${{ matrix.ENABLE_RTTI }}
- name: Get MLIR
id: mlir-wheels
run: |
VERSION=$(utils/clone-llvm.sh --get-wheel-version)
if [ x"${{ matrix.ENABLE_RTTI }}" == x"OFF"]; then
WHEEL=mlir_no_rtti
else
WHEEL=mlir
fi
pip -q download $WHEEL==$VERSION \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro
unzip -q mlir-*.whl
# Build the repo test target in release mode to build and test.
- name: Build and test
run: |
mkdir -p build_release/install
cd build_release
if [ x"${{ contains(matrix.OS, 'windows') }}" == x"true" ]; then
LLVM_EXTERNAL_LIT="$(where lit)"
else
LLVM_EXTERNAL_LIT="$(which lit)"
fi
cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DCMAKE_C_VISIBILITY_PRESET=hidden \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DCMAKE_INSTALL_PREFIX=$PWD/install \
-DAIE_COMPILER=NONE \
-DAIE_LINKER=NONE \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DHOST_COMPILER=NONE \
-DLLVM_ENABLE_ASSERTIONS=${{ matrix.ENABLE_ASSERTIONS }} \
-DLLVM_ENABLE_RTTI=${{ matrix.ENABLE_RTTI }} \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_EXTERNAL_LIT="$LLVM_EXTERNAL_LIT"
ninja
# tests hang/fail on windows
if [ x"${{ contains(matrix.OS, 'windows') }}" == x"false" ]; then
ninja check-aie
ninja check-tutorials
ninja check-reference-designs
ninja check-programming-guide
fi