InfiniTensor/.github/workflows/build.yml

71 lines
1.8 KiB
YAML
Raw Normal View History

name: Build and test cpu
on:
pull_request:
paths-ignore:
- '**.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/onnx/models/raw/main/vision/classification/resnet/model/resnet18-v2-7.onnx
resnet-file: resnet18-v2-7.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 model
run: wget ${{ env.resnet-download }}
- name: Test onnx frontend
run: make test-onnx