forked from onnx/onnx-mlir
-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (61 loc) · 2.26 KB
/
ubuntu-build.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
name: Out-of-tree build
on:
pull_request:
push:
branches: [ main, feature/onnx-to-tosa ]
concurrency:
# Build every push to main
# Only build the newest PR; cancel older builds of a PR
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: install tools that are needed for compilation
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ cmake ninja-build
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
# A full build of llvm, clang, lld, and lldb takes about 250MB
# of ccache space. There's not much reason to have more than this,
# because we usually won't need to save cache entries from older
# builds. Also, there is an overall 10GB cache limit, and each
# run creates a new cache entry so we want to ensure that we have
# enough cache space for all the tests to run at once and still
# fit under the 10 GB limit.
max-size: 500M
key: sccache
variant: sccache
create-symlink: true
- name: install dependencies
run: |
utils/install-protobuf.sh
utils/install-venv.sh
- name: clone & build MLIR
run: |
cd ..
export EXTRA_CMAKE_ARGS="-DLLVM_USE_LINKER=lld -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
sh onnx-mlir/utils/clone-mlir.sh
sh onnx-mlir/utils/build-mlir.sh
- name: build onnx-mlir
run: |
cd ..
export EXTRA_CMAKE_ARGS="-DONNX_MLIR_ENABLE_STABLEHLO=OFF -DLLVM_USE_LINKER=lld -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
bash onnx-mlir/utils/install-onnx-mlir.sh
- name: build and run docs/doc_example tests
run: |
cd ..
sh onnx-mlir/utils/check-doc-example.sh
- name: build and run unit tests
run: |
cd ..
sh onnx-mlir/utils/check-unittest.sh