mirror of
https://github.com/Tencent/ncnn.git
synced 2026-10-24 01:29:31 +08:00
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
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
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
linux-clang-python:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: [3.6, 3.7, 3.8, 3.9]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: set up python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
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 -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
|
|
- 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/*
|