-
Notifications
You must be signed in to change notification settings - Fork 4.2k
68 lines (66 loc) · 1.81 KB
/
linux-x64-cpu-clang-python.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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-20.04
strategy:
matrix:
python-version: [3.7, 3.9, 3.11]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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_DISABLE_RTTI=OFF -DNCNN_DISABLE_EXCEPTION=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
- name: build
run: cmake --build build -j $(nproc)
- 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/*