Skip to content

Commit 727fba0

Browse files
committed
Add keras unit tests.
Signed-off-by: Jay Zhang <jiz@microsoft.com>
1 parent f6a8fc7 commit 727fba0

File tree

6 files changed

+74
-3
lines changed

6 files changed

+74
-3
lines changed

.github/workflows/keras_application_test_core.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: Keras2Onnx Application Tests (Core)
1+
name: Keras2onnx Application Tests (Core)
22

33
on:
44
pull_request:
5+
branches:
6+
- main
57
push:
68
branches:
79
- main
810

911
jobs:
10-
run_tests:
12+
run_tests_linux:
1113
strategy:
1214
matrix:
1315
tf_version: ['2.9.0', '2.13.0']
@@ -61,6 +63,7 @@ jobs:
6163
pip install keras-self-attention
6264
pip install pytest pytest-cov pytest-runner
6365
66+
echo "----- List all of depdencies:"
6467
pip freeze --all
6568
6669
- name: Run keras application tests
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Keras2onnx Unit Tests (Core)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
run_tests_linux:
13+
strategy:
14+
matrix:
15+
tf_version: ['2.9.0', '2.13.0']
16+
python_version: ['3.8', '3.9', '3.10']
17+
opset_version: ['18', '15']
18+
ort_version: ['1.16.3']
19+
onnx_version: ['1.15.0']
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Set up Python (${{ matrix.python_version }})
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python_version }}
28+
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Install dependencies (tf v${{ matrix.tf_version }})
33+
shell: bash
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install onnxconverter-common
37+
pip install onnx==${{ matrix.onnx_version }}
38+
pip uninstall -y protobuf
39+
pip install "protobuf~=3.20"
40+
pip install h5py==3.7.0
41+
pip install parameterized
42+
pip install timeout-decorator
43+
pip install coloredlogs flatbuffers
44+
pip install tensorflow==${{ matrix.tf_version }}
45+
pip install -r requirements.txt
46+
pip install -r requirements-dev.txt
47+
pip install pytest pytest-cov pytest-runner
48+
pip install onnxruntime==${{ matrix.ort_version }}
49+
50+
echo "----- List all of depdencies:"
51+
pip freeze --all
52+
53+
- name: Run keras unit tests
54+
run: |
55+
set -x
56+
status=0
57+
python -c "import onnxruntime"
58+
python -c "import onnxconverter_common"
59+
pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
60+
exit $status
61+

.github/workflows/pretrained_model_tests_core.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Pretrained Model Test (Core)
22

33
on:
44
pull_request:
5+
branches:
6+
- main
57
push:
68
branches:
79
- main

.github/workflows/pylint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: Pylint Workflow
22

33
on:
4+
pull_request:
5+
branches:
6+
- main
47
push:
58
branches:
69
- main
7-
pull_request:
810

911
jobs:
1012
pylint:

.github/workflows/unit_tests_core.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Unit Tests (Core)
22

33
on:
44
pull_request:
5+
branches:
6+
- main
57
push:
68
branches:
79
- main

tests/utils/setup_test_env.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ pip install "protobuf~=3.20"
2828

2929
python setup.py install
3030

31+
echo "----- List all of depdencies:"
3132
pip freeze --all

0 commit comments

Comments
 (0)