2023-02-12 00:01:36 +08:00
|
|
|
name: Build and test cpu
|
|
|
|
on:
|
2023-03-29 15:47:32 +08:00
|
|
|
push:
|
2023-04-18 15:10:33 +08:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- 'LICENSE'
|
2023-02-12 00:01:36 +08:00
|
|
|
pull_request:
|
2023-10-10 15:45:27 +08:00
|
|
|
paths:
|
2023-02-12 00:01:36 +08:00
|
|
|
- '**.md'
|
|
|
|
- 'LICENSE'
|
|
|
|
|
|
|
|
env:
|
2023-02-12 08:23:49 +08:00
|
|
|
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"
|
2023-04-18 15:10:33 +08:00
|
|
|
|
2023-02-12 08:23:49 +08:00
|
|
|
resnet-download: https://github.com/onnx/models/raw/main/vision/classification/resnet/model/resnet18-v2-7.onnx
|
2023-04-18 15:10:33 +08:00
|
|
|
inception-download: https://media.githubusercontent.com/media/onnx/models/main/vision/classification/inception_and_googlenet/inception_v2/model/inception-v2-9.onnx
|
|
|
|
densenet-download: https://github.com/onnx/models/raw/main/vision/classification/densenet-121/model/densenet-12.onnx
|
|
|
|
efficientnet-download: https://github.com/onnx/models/raw/main/vision/classification/efficientnet-lite4/model/efficientnet-lite4-11.onnx
|
2023-02-12 00:01:36 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2023-02-12 08:23:49 +08:00
|
|
|
- name: Set up Python ${{ env.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ env.python-version }}
|
|
|
|
|
2023-02-12 00:01:36 +08:00
|
|
|
- name: Install libdw
|
|
|
|
run: sudo apt-get update && sudo apt-get install libdw-dev
|
|
|
|
|
2023-04-18 15:10:33 +08:00
|
|
|
# - name: Cache protobuf
|
|
|
|
# id: cache-protobuf
|
|
|
|
# uses: actions/cache@v3
|
|
|
|
# with:
|
|
|
|
# path: protobuf-${{ env.protobuf-version }}
|
|
|
|
# key: protobuf-${{ env.protobuf-version }}
|
2023-02-12 00:01:36 +08:00
|
|
|
|
2023-04-18 15:10:33 +08:00
|
|
|
# - 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
|
2023-02-12 00:01:36 +08:00
|
|
|
|
2023-04-18 15:10:33 +08:00
|
|
|
# - name: Install protobuf
|
|
|
|
# run: |
|
|
|
|
# cd protobuf-${{ env.protobuf-version }}
|
|
|
|
# sudo make install
|
|
|
|
# sudo ldconfig
|
2023-02-12 00:01:36 +08:00
|
|
|
|
|
|
|
- name: Build
|
2023-02-12 08:23:49 +08:00
|
|
|
run: make
|
2023-02-12 00:01:36 +08:00
|
|
|
|
|
|
|
- name: Test cpu
|
2023-02-12 08:23:49 +08:00
|
|
|
run: make test-cpp
|
|
|
|
|
|
|
|
- name: Install python-frontend
|
2023-02-12 00:01:36 +08:00
|
|
|
run: |
|
2023-02-12 08:23:49 +08:00
|
|
|
python -m pip install --upgrade pip
|
|
|
|
make install-python
|
|
|
|
|
2023-04-18 15:10:33 +08:00
|
|
|
- name: Download test models
|
|
|
|
run: |
|
|
|
|
wget ${{ env.resnet-download }}
|
|
|
|
wget ${{ env.inception-download }}
|
|
|
|
wget ${{ env.densenet-download }}
|
|
|
|
wget ${{ env.efficientnet-download }}
|
2023-02-12 08:23:49 +08:00
|
|
|
|
|
|
|
- name: Test onnx frontend
|
|
|
|
run: make test-onnx
|