Skip to content

Commit f06f819

Browse files
committed
cicd: add a simple offline model testing.
Signed-off-by: Tao Peng <[email protected]>
1 parent 2c0e11d commit f06f819

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/build_x86_64_npu.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
".github/**.yaml"
6767
"cibuild/**.sh"
6868
"setup.py"
69+
"examples/generate.py"
6970
)
7071
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }})
7172
requires_approval="false"
@@ -124,4 +125,4 @@ jobs:
124125
timeout-minutes: 60
125126
run: |
126127
chmod +x ./cibuild/build_npu.sh
127-
bash cibuild/build_npu.sh 'pip install pre-commit -i https://pypi.tuna.tsinghua.edu.cn/simple; python setup.py build; python setup.py test'
128+
bash cibuild/build_npu.sh 'pip install pre-commit -i https://pypi.tuna.tsinghua.edu.cn/simple; python setup.py bdist_wheel; pip install dist/* --force-reinstall; python examples/generate.py --model="/export/home/models/Qwen2-7B-Instruct" --devices="npu:7"'

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,13 @@ def run(self):
389389
build_ext_cmd = self.get_finalized_command('build_ext')
390390
build_ext_cmd.device = self.device
391391
build_ext_cmd.arch = self.arch
392-
self.run_command('build_ext')
392+
393+
print("🔨 build project...")
394+
self.run_command('build')
395+
396+
print("🧪 testing UT...")
397+
self.run_command('test')
398+
393399
if self.arch == 'arm':
394400
ext_path = get_base_dir() + "/build/lib.linux-aarch64-cpython-311/"
395401
else:

0 commit comments

Comments
 (0)