-
Notifications
You must be signed in to change notification settings - Fork 414
138 lines (117 loc) · 3.56 KB
/
test-build-wheel.yaml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: test-build-wheel
on:
push:
branches:
- master
paths:
- 'setup.py'
- '.github/workflows/test-build-wheel.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/python/**'
pull_request:
branches:
- master
paths:
- 'setup.py'
- '.github/workflows/test-build-wheel.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/python/**'
workflow_dispatch:
concurrency:
group: test-build-wheel-${{ github.ref }}
cancel-in-progress: true
jobs:
test-build-wheel:
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# See https://github.com/actions/runner-images
include:
- os: ubuntu-20.04
python-version: "3.7"
- os: ubuntu-20.04
python-version: "3.8"
- os: ubuntu-20.04
python-version: "3.9"
- os: ubuntu-22.04
python-version: "3.10"
- os: ubuntu-22.04
python-version: "3.11"
- os: ubuntu-22.04
python-version: "3.12"
- os: macos-11
python-version: "3.7"
- os: macos-12
python-version: "3.8"
- os: macos-13
python-version: "3.9"
- os: macos-13
python-version: "3.10"
- os: macos-13
python-version: "3.11"
- os: macos-14
python-version: "3.12"
- os: windows-2022
python-version: "3.7"
- os: windows-2022
python-version: "3.8"
- os: windows-2022
python-version: "3.9"
- os: windows-2022
python-version: "3.10"
- os: windows-2022
python-version: "3.11"
- os: windows-2022
python-version: "3.12"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.python_version }}
- name: Install python dependencies
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
- name: Build
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --version
export SHERPA_ONNX_MAKE_ARGS="VERBOSE=1 -j"
python3 setup.py bdist_wheel
ls -lh dist
- name: Display wheel
shell: bash
run: |
ls -lh dist
- name: Install wheel
shell: bash
run: |
pip install --verbose ./dist/*.whl
- name: Test
shell: bash
run: |
# For windows
export PATH=/c/hostedtoolcache/windows/Python/3.7.9/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.8.10/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.11.9/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.12.3/x64/bin:$PATH
which sherpa-onnx
sherpa-onnx --help