Skip to content

Commit 83219cb

Browse files
committed
Add more windows tests, and publish test results.
Signed-off-by: Jay Zhang <jiz@microsoft.com>
1 parent ec60ede commit 83219cb

File tree

4 files changed

+194
-113
lines changed

4 files changed

+194
-113
lines changed

.github/workflows/keras_application_test_core.yml

Lines changed: 114 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ on:
99
- main
1010

1111
jobs:
12-
run_tests_linux:
12+
run_tests:
1313
strategy:
1414
matrix:
1515
tf_version: ['2.9.0', '2.13.0']
1616
python_version: ['3.8', '3.9']
1717
opset_version: ['18', '15']
1818
ort_version: ['1.16.3']
1919
onnx_version: ['1.15.0']
20+
os: ['ubuntu-latest', 'windows-2022']
2021

21-
runs-on: ubuntu-latest
22+
runs-on: ${{ matrix.os }}
2223

2324
steps:
2425
- name: Set up Python (${{ matrix.python_version }})
@@ -29,7 +30,7 @@ jobs:
2930
- name: Checkout code
3031
uses: actions/checkout@v4
3132

32-
- name: Install dependencies (tf v${{ matrix.tf_version }})
33+
- name: Install dependencies (TF-v${{ matrix.tf_version }})
3334
shell: bash
3435
run: |
3536
python -m pip install --upgrade pip
@@ -62,17 +63,122 @@ jobs:
6263
pip install keras-self-attention
6364
pip install pytest pytest-cov pytest-runner
6465
66+
pip install -e .
67+
6568
echo "----- List all of depdencies:"
6669
pip freeze --all
6770
68-
- name: Run keras application tests
71+
- name: Run keras application tests (${{ matrix.os }})
6972
run: |
70-
set -x
71-
status=0
72-
pip install -e .
7373
python -c "import onnxruntime"
7474
pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
7575
cd tests/keras2onnx_applications/nightly_build
7676
python run_all_v2.py
77-
exit $status
7877
78+
run_tests_tf_15:
79+
strategy:
80+
matrix:
81+
tf_version: ['1.15.0']
82+
python_version: ['3.7'] # Max version that supports tf 1.15
83+
opset_version: ['18', '15']
84+
ort_version: ['1.14.1'] # Max version that supports python 3.7
85+
onnx_version: ['1.14.1'] # Max version that supports python 3.7
86+
os: ['ubuntu-latest', 'windows-2022']
87+
88+
runs-on: ${{ matrix.os }}
89+
90+
steps:
91+
- name: Set up Python (${{ matrix.python_version }})
92+
uses: actions/setup-python@v5
93+
with:
94+
python-version: ${{ matrix.python_version }}
95+
96+
- name: Checkout code
97+
uses: actions/checkout@v4
98+
99+
- name: Install dependencies (TF-v${{ matrix.tf_version }})
100+
shell: bash
101+
run: |
102+
python -m pip install --upgrade pip
103+
pip install onnxconverter-common
104+
pip install onnx==${{ matrix.onnx_version }}
105+
pip uninstall -y protobuf
106+
pip install "protobuf~=3.20"
107+
pip install h5py==3.7.0
108+
pip install parameterized
109+
pip install timeout-decorator
110+
pip install coloredlogs flatbuffers
111+
pip install tensorflow==${{ matrix.tf_version }}
112+
pip install keras==2.3.1
113+
pip install onnxruntime==${{ matrix.ort_version }}
114+
pip install Pillow==8.2.0
115+
pip install opencv-python
116+
pip install tqdm
117+
pip install keras-segmentation==0.2.0
118+
git clone https://github.com/matterport/Mask_RCNN
119+
cd Mask_RCNN
120+
pip install -r requirements.txt
121+
python setup.py install
122+
cd ..
123+
pip install matplotlib
124+
git clone https://github.com/qqwweee/keras-yolo3
125+
pip install keras-resnet
126+
pip install git+https://www.github.com/keras-team/keras-contrib.git
127+
pip install keras-tcn==2.8.3
128+
pip install git+https://github.com/qubvel/efficientnet
129+
pip install transformers==4.2.0
130+
pip install keras-self-attention
131+
pip install pytest pytest-cov pytest-runner
132+
pip install numpy==1.19.0
133+
pip install h5py==2.9.0
134+
135+
pip install -e .
136+
137+
echo "----- List all of depdencies:"
138+
pip freeze --all
139+
140+
- name: Run keras application tests (${{ matrix.os }})
141+
run: |
142+
python -c "import onnxruntime"
143+
pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
144+
cd tests/keras2onnx_applications/nightly_build
145+
python run_all_v2.py --exclude "test_keras_applications_v2.py"
146+
147+
148+
publish-test-results:
149+
name: "Publish Tests Results to Github"
150+
needs: run_tests
151+
runs-on: ubuntu-latest
152+
permissions:
153+
checks: write
154+
pull-requests: write
155+
if: always()
156+
steps:
157+
- name: Download Artifacts
158+
uses: actions/download-artifact@v3
159+
with:
160+
path: artifacts
161+
162+
- name: Publish Test Results
163+
uses: EnricoMi/publish-unit-test-result-action@v2
164+
with:
165+
files: "artifacts/**/*.xml"
166+
167+
publish-test-results-tf-15:
168+
name: "Publish Tests Results(TF15) to Github"
169+
needs: run_tests_tf_15
170+
runs-on: ubuntu-latest
171+
permissions:
172+
checks: write
173+
pull-requests: write
174+
if: always()
175+
steps:
176+
- name: Download Artifacts
177+
uses: actions/download-artifact@v3
178+
with:
179+
path: artifacts
180+
181+
- name: Publish Test Results
182+
uses: EnricoMi/publish-unit-test-result-action@v2
183+
with:
184+
files: "artifacts/**/*.xml"

.github/workflows/keras_unit_test_core.yml

Lines changed: 41 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -9,65 +9,17 @@ on:
99
- main
1010

1111
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 install h5py==3.7.0
39-
# pip install parameterized
40-
# pip install timeout-decorator
41-
# pip install coloredlogs flatbuffers
42-
# pip install tensorflow==${{ matrix.tf_version }}
43-
# pip install pytest pytest-cov pytest-runner
44-
# pip install onnxruntime==${{ matrix.ort_version }}
45-
# pip uninstall -y protobuf
46-
# pip install "protobuf~=3.20"
47-
# pip install -e .
48-
49-
# echo "----- List all of depdencies:"
50-
# pip freeze --all
51-
52-
# - name: Run keras unit tests
53-
# run: |
54-
# set -x
55-
# status=0
56-
# python -c "import onnxruntime"
57-
# python -c "import onnxconverter_common"
58-
# pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
59-
# exit $status
60-
61-
run_tests_windows:
12+
run_tests:
6213
strategy:
6314
matrix:
6415
tf_version: ['2.9.0', '2.13.0']
6516
python_version: ['3.8', '3.9', '3.10']
6617
opset_version: ['18', '15']
6718
ort_version: ['1.16.3']
6819
onnx_version: ['1.15.0']
20+
os: ['ubuntu-latest', 'windows-2022']
6921

70-
runs-on: windows-2022
22+
runs-on: ${{ matrix.os }}
7123

7224
steps:
7325
- name: Set up Python (${{ matrix.python_version }})
@@ -78,7 +30,7 @@ jobs:
7830
- name: Checkout code
7931
uses: actions/checkout@v4
8032

81-
- name: Install dependencies (tf v${{ matrix.tf_version }})
33+
- name: Install dependencies (TF-v${{ matrix.tf_version }})
8234
shell: bash
8335
run: |
8436
python -m pip install --upgrade pip
@@ -98,22 +50,23 @@ jobs:
9850
echo "----- List all of depdencies:"
9951
pip freeze --all
10052
101-
- name: Run keras unit tests
53+
- name: Run keras unit tests (${{ matrix.os }})
10254
run: |
10355
python -c "import onnxruntime"
10456
python -c "import onnxconverter_common"
10557
pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
10658
107-
run_tests_linux_TF_15:
59+
run_tests_tf_15:
10860
strategy:
10961
matrix:
11062
tf_version: ['1.15.0']
11163
python_version: ['3.7'] # Max version that supports tf 1.15
11264
opset_version: ['18', '15']
11365
ort_version: ['1.14.1'] # Max version that supports python 3.7
11466
onnx_version: ['1.14.1'] # Max version that supports python 3.7
67+
os: ['ubuntu-latest', 'windows-2022']
11568

116-
runs-on: ubuntu-latest
69+
runs-on: ${{ matrix.os }}
11770

11871
steps:
11972
- name: Set up Python (${{ matrix.python_version }})
@@ -145,58 +98,46 @@ jobs:
14598
echo "----- List all of depdencies:"
14699
pip freeze --all
147100
148-
- name: Run keras unit tests
101+
- name: Run keras unit tests (${{ matrix.os }})
149102
run: |
150-
set -x
151-
status=0
152103
python -c "import onnxruntime"
153104
python -c "import onnxconverter_common"
154105
pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
155-
exit $status
156-
157-
run_tests_windows_TF_15:
158-
strategy:
159-
matrix:
160-
tf_version: ['1.15.0']
161-
python_version: ['3.7'] # Max version that supports tf 1.15
162-
opset_version: ['18', '15']
163-
ort_version: ['1.14.1'] # Max version that supports python 3.7
164-
onnx_version: ['1.14.1'] # Max version that supports python 3.7
165-
166-
runs-on: windows-2022
167106
107+
publish-test-results:
108+
name: "Publish Tests Results to Github"
109+
needs: run_tests
110+
runs-on: ubuntu-latest
111+
permissions:
112+
checks: write
113+
pull-requests: write
114+
if: always()
168115
steps:
169-
- name: Set up Python (${{ matrix.python_version }})
170-
uses: actions/setup-python@v5
116+
- name: Download Artifacts
117+
uses: actions/download-artifact@v3
171118
with:
172-
python-version: ${{ matrix.python_version }}
173-
174-
- name: Checkout code
175-
uses: actions/checkout@v4
119+
path: artifacts
176120

177-
- name: Install dependencies (tf v${{ matrix.tf_version }})
178-
shell: bash
179-
run: |
180-
python -m pip install --upgrade pip
181-
pip install onnxconverter-common
182-
pip install onnx==${{ matrix.onnx_version }}
183-
pip uninstall -y protobuf
184-
pip install "protobuf~=3.20"
185-
pip install h5py==3.7.0
186-
pip install parameterized
187-
pip install timeout-decorator
188-
pip install coloredlogs flatbuffers
189-
pip install tensorflow==${{ matrix.tf_version }}
190-
pip install pytest pytest-cov pytest-runner
191-
pip install onnxruntime==${{ matrix.ort_version }}
192-
pip install numpy==1.19.0
193-
pip install -e .
121+
- name: Publish Test Results
122+
uses: EnricoMi/publish-unit-test-result-action@v2
123+
with:
124+
files: "artifacts/**/*.xml"
194125

195-
echo "----- List all of depdencies:"
196-
pip freeze --all
126+
publish-test-results-tf-15:
127+
name: "Publish Tests Results(TF15) to Github"
128+
needs: run_tests_tf_15
129+
runs-on: ubuntu-latest
130+
permissions:
131+
checks: write
132+
pull-requests: write
133+
if: always()
134+
steps:
135+
- name: Download Artifacts
136+
uses: actions/download-artifact@v3
137+
with:
138+
path: artifacts
197139

198-
- name: Run keras unit tests
199-
run: |
200-
python -c "import onnxruntime"
201-
python -c "import onnxconverter_common"
202-
pytest tests/keras2onnx_unit_tests --doctest-modules --junitxml=junit/test-results.xml
140+
- name: Publish Test Results
141+
uses: EnricoMi/publish-unit-test-result-action@v2
142+
with:
143+
files: "artifacts/**/*.xml"

.github/workflows/pretrained_model_tests_core.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
3030

31-
- name: Install dependencies (tf v${{ matrix.tf_version }})
31+
- name: Install dependencies (TF-v${{ matrix.tf_version }})
3232
shell: bash
3333
run: |
3434
chmod +x ./tests/utils/setup_test_env.sh
@@ -44,10 +44,25 @@ jobs:
4444
4545
- name: Run pretrained_model_test
4646
run: |
47-
set -x
48-
status=0
4947
# TODO: fix unity model path
5048
# python tests/run_pretrained_models.py --backend $CI_ONNX_BACKEND --opset $CI_ONNX_OPSET --config tests/unity.yaml || status=$?
5149
python tests/run_pretrained_models.py --backend onnxruntime --opset ${{ matrix.opset_version }} --skip_tf_tests False --skip_tflite_tests False --skip_tfjs_tests True --config tests/run_pretrained_models.yaml || status=$?
52-
exit $status
5350
51+
publish-test-results:
52+
name: "Publish Tests Results to Github"
53+
needs: run_tests
54+
runs-on: ubuntu-latest
55+
permissions:
56+
checks: write
57+
pull-requests: write
58+
if: always()
59+
steps:
60+
- name: Download Artifacts
61+
uses: actions/download-artifact@v3
62+
with:
63+
path: artifacts
64+
65+
- name: Publish Test Results
66+
uses: EnricoMi/publish-unit-test-result-action@v2
67+
with:
68+
files: "artifacts/**/*.xml"

0 commit comments

Comments
 (0)