Skip to content

Add Ubuntu ci

Add Ubuntu ci #10

Workflow file for this run

name: GitHub Action Ubuntu
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 protobuf-compiler
- 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 protobuf
# run: |
# sudo sh utils/install-protobuf.sh
#- name: cache MLIR directory
# id: cache-mlir
# uses: actions/cache@v3
# with:
# path: ~/work/onnx-mlir/llvm-project
# key: ${{ runner.os }}-mlir-${{ hashFiles('**/clone-mlir.sh', '**/build-mlir.sh') }}
- name: clone & build MLIR
#if: steps.cache-mlir.outputs.cache-hit != 'true'
run: |
sh utils/clone-mlir.sh
sh utils/build-mlir.sh
- name: install python requirements
run: |
python3 -m pip install --upgrade wheel
python3 -m pip install -r requirements.txt
- name: install third_party/onnx
run: |
cd third_party/onnx
python3 -m pip install -v .
- name: build onnx-mlir
run: |
export EXTRA_CMAKE_ARGS="-DONNX_MLIR_ENABLE_STABLEHLO=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
sh utils/install-onnx-mlir.sh
- name: build and run docs/doc_example tests
run: |
sh utils/check-doc-example.sh
- name: build and run unit tests
run: |
sh utils/check-unittest.sh
# Those tests are not relevant to the work on the xilinx fork, but take
# 40 min. Don't run them on PRs.
#- name: run onnx-mlir backend and numerical tests
# run: |
# sh utils/check-onnx-backend-numerical.sh