Skip to content

Commit 0467444

Browse files
committed
Add unit test workflow.
Signed-off-by: Jay Zhang <jiz@microsoft.com>
1 parent 3e2a2e9 commit 0467444

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/unit_tests_core.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Unit Tests (Core)
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
setup:
11+
strategy:
12+
matrix:
13+
tf_version: ['2.9.0', '2.15.0']
14+
python_version: ['3.8', '3.9', '3.10']
15+
opset_version: ['18', '15']
16+
ort_version: ['1.16.3']
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Set up Python (${{ matrix.python_version }})
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python_version }}
25+
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Install dependencies (tf v${{ matrix.tf_version }})
30+
shell: bash
31+
run: |
32+
chmod +x ./tests/setup_test_env.sh
33+
./tests/setup_test_env.sh ${{ matrix.tf_version }} ${{ matrix.ort_version }}
34+
35+
- name: Fix Paths (Windows only)
36+
if: runner.os == 'Windows'
37+
run: |
38+
$site_dir = python -c "import site; print(site.getsitepackages()[1])"
39+
echo "##vso[task.prependpath]$site_dir\numpy\.libs"
40+
$base_dir = python -c "import site; print(site.getsitepackages()[0])"
41+
echo "##vso[task.prependpath]$base_dir/Library/bin"
42+
43+
- name: Run unit_test
44+
run: |
45+
set -x
46+
status=0
47+
export TF2ONNX_TEST_BACKEND=onnxruntime
48+
export TF2ONNX_TEST_OPSET=${{ matrix.opset_version }}
49+
export TF2ONNX_SKIP_TFLITE_TESTS=False
50+
export TF2ONNX_SKIP_TFJS_TESTS=True
51+
export TF2ONNX_SKIP_TF_TESTS=False
52+
python -m pytest --cov=tf2onnx --cov-report=term --disable-pytest-warnings -r s tests --cov-append
53+
exit $status
54+

0 commit comments

Comments
 (0)