|
- name: linux-x64-cpu-clang-python
- on:
- push:
- branches: [master]
- paths:
- - '.github/workflows/linux-x64-cpu-clang-python.yml'
- - 'CMakeLists.txt'
- - 'cmake/**'
- - 'src/*'
- - 'src/layer/*'
- - 'src/layer/x86/**'
- - 'python/**'
- pull_request:
- branches: [master]
- paths:
- - '.github/workflows/linux-x64-cpu-clang-python.yml'
- - 'CMakeLists.txt'
- - 'cmake/**'
- - 'src/*'
- - 'src/layer/*'
- - 'src/layer/x86/**'
- - 'python/**'
- concurrency:
- group: linux-x64-cpu-clang-python-${{ github.ref }}
- cancel-in-progress: true
- jobs:
- linux-clang-python:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- python-version: [3.6, 3.7, 3.8, 3.9]
-
- steps:
- - uses: actions/checkout@v2
- with:
- submodules: true
- - name: update
- run: sudo apt-get update
- - name: protobuf
- run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev
- - name: set up python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
- with:
- python-version: ${{ matrix.python-version }}
- - name: Install dependencies
- run: |
- python -m pip install --upgrade pip
- pip install pytest setuptools wheel twine
- - name: configure
- env:
- CC: clang
- CXX: clang++
- run: mkdir build && cd build && cmake -DNCNN_PYTHON=ON ..
- - name: build
- run: cmake --build build -j 2
- - name: install python
- run: cd python && pip install .
- - name: test
- run: cd python && pytest tests
- - name: build and publish
- if: startsWith(github.ref, 'refs/tags')
- env:
- TWINE_USERNAME: __token__
- TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
- TWINE_REPOSITORY_URL: "https://test.pypi.org/legacy/"
- run: |
- cd python
- python setup.py bdist_wheel
- twine upload dist/*
|