name: linux-x64-cpu-clang-python on: push: branches: [master] paths-ignore: ['**.md'] pull_request: branches: [master] paths-ignore: ['**.md'] jobs: linux-clang-python: runs-on: ubuntu-latest strategy: matrix: python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - name: cancel-previous-runs uses: styfle/cancel-workflow-action@0.7.0 with: access_token: ${{ secrets.GITHUB_TOKEN }} - 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/*