InfiniTensor/.github/workflows/build.yml

82 lines
2.3 KiB
YAML

name: Build and test cpu
on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
pull_request:
paths:
- '**.md'
- 'LICENSE'
env:
protobuf-download: https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protobuf-cpp-3.21.12.tar.gz
protobuf-version: "3.21.12"
python-version: "3.10"
resnet-download: https://github.com/InfiniTensor/InfiniTensor/releases/download/test-models/resnet18-v2-7.onnx
inception-download: https://github.com/InfiniTensor/InfiniTensor/releases/download/test-models/inception-v2-9.onnx
densenet-download: https://github.com/InfiniTensor/InfiniTensor/releases/download/test-models/densenet-12.onnx
efficientnet-download: https://github.com/InfiniTensor/InfiniTensor/releases/download/test-models/efficientnet-lite4-11.onnx
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install libdw
run: sudo apt-get update && sudo apt-get install libdw-dev
# - name: Cache protobuf
# id: cache-protobuf
# uses: actions/cache@v3
# with:
# path: protobuf-${{ env.protobuf-version }}
# key: protobuf-${{ env.protobuf-version }}
# - name: Download and compile protobuf
# if: steps.cache-protobuf.outputs.cache-hit != 'true'
# run: |
# wget ${{ env.protobuf-download }}
# tar xf protobuf-cpp-${{ env.protobuf-version }}.tar.gz
# cd protobuf-${{ env.protobuf-version }}
# ./autogen.sh
# ./configure CFLAGS="-fPIC" CXXFLAGS="-fPIC"
# make -j8
# - name: Install protobuf
# run: |
# cd protobuf-${{ env.protobuf-version }}
# sudo make install
# sudo ldconfig
- name: Build
run: make
- name: Test cpu
run: make test-cpp
- name: Install python-frontend
run: |
python -m pip install --upgrade pip
make install-python
- name: Download test models
run: |
wget ${{ env.resnet-download }}
wget ${{ env.inception-download }}
wget ${{ env.densenet-download }}
wget ${{ env.efficientnet-download }}
- name: Test onnx frontend
run: make test-onnx