diff --git a/.github/workflows/keras_application_test_core.yml b/.github/workflows/keras_application_test_ci.yml similarity index 90% rename from .github/workflows/keras_application_test_core.yml rename to .github/workflows/keras_application_test_ci.yml index d35ece74f..1e4554f88 100644 --- a/.github/workflows/keras_application_test_core.yml +++ b/.github/workflows/keras_application_test_ci.yml @@ -1,4 +1,4 @@ -name: Keras2onnx Application Tests (CI) +name: Keras2onnx App Test (CI) on: pull_request: @@ -9,16 +9,33 @@ on: - main workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} + cancel-in-progress: true + jobs: run_tests: strategy: + fail-fast: false matrix: - tf_version: ['2.9.0', '2.13.0'] - python_version: ['3.8', '3.9'] + name: + - 'py38-tf2.9' + - 'py39-tf2.10' + - 'py39-tf2.15' + os: ['ubuntu-latest', 'windows-2022'] opset_version: ['18', '15'] ort_version: ['1.16.3'] - onnx_version: ['1.15.0'] - os: ['ubuntu-latest', 'windows-2022'] + onnx_version: ['1.16.1'] + include: + - name: 'py38-tf2.9' + tf_version: '2.9.0' + python_version: '3.8' + - name: 'py39-tf2.10' + tf_version: '2.10.0' + python_version: '3.9' + - name: 'py39-tf2.15' + tf_version: '2.15.0' + python_version: '3.9' runs-on: ${{ matrix.os }} @@ -63,6 +80,7 @@ jobs: pip install transformers==4.2.0 pip install keras-self-attention pip install pytest pytest-cov pytest-runner + pip install "numpy<2" pip install -e . diff --git a/.github/workflows/keras_unit_test_core.yml b/.github/workflows/keras_unit_test_ci.yml similarity index 85% rename from .github/workflows/keras_unit_test_core.yml rename to .github/workflows/keras_unit_test_ci.yml index 3894ca166..d3adb640c 100644 --- a/.github/workflows/keras_unit_test_core.yml +++ b/.github/workflows/keras_unit_test_ci.yml @@ -1,4 +1,4 @@ -name: Keras2onnx Unit Tests (CI) +name: Keras2onnx Unit Test (CI) on: pull_request: @@ -9,16 +9,37 @@ on: - main workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} + cancel-in-progress: true + jobs: run_tests: strategy: + fail-fast: false matrix: - tf_version: ['2.9.0', '2.13.0'] - python_version: ['3.8', '3.9'] + name: + - 'py38-tf2.9' + - 'py39-tf2.10' + - 'py39-tf2.14' + - 'py310-tf2.15' + os: ['ubuntu-latest', 'windows-2022'] opset_version: ['18', '15'] ort_version: ['1.16.3'] - onnx_version: ['1.15.0'] - os: ['ubuntu-latest', 'windows-2022'] + onnx_version: ['1.16.1'] + include: + - name: 'py38-tf2.9' + tf_version: '2.9.0' + python_version: '3.8' + - name: 'py39-tf2.10' + tf_version: '2.10.0' + python_version: '3.9' + - name: 'py39-tf2.14' + tf_version: '2.14.0' + python_version: '3.9' + - name: 'py310-tf2.15' + tf_version: '2.15.0' + python_version: '3.10' runs-on: ${{ matrix.os }} @@ -46,6 +67,8 @@ jobs: pip install onnxruntime==${{ matrix.ort_version }} pip uninstall -y protobuf pip install "protobuf~=3.20" + pip install "numpy<2" + pip install -e . echo "----- List all of depdencies:" diff --git a/.github/workflows/pretrained_model_tests_core.yml b/.github/workflows/pretrained_model_tests_ci.yml similarity index 66% rename from .github/workflows/pretrained_model_tests_core.yml rename to .github/workflows/pretrained_model_tests_ci.yml index 0df68887f..cc3826c69 100644 --- a/.github/workflows/pretrained_model_tests_core.yml +++ b/.github/workflows/pretrained_model_tests_ci.yml @@ -9,14 +9,43 @@ on: - main workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} + cancel-in-progress: true + jobs: run_tests: strategy: + fail-fast: false matrix: - tf_version: ['2.9.0', '2.13.0'] - python_version: ['3.8', '3.9', '3.10'] + name: + - 'py38-tf2.9' + - 'py39-tf2.9' + - 'py39-tf2.15' + - 'py310-tf2.15' opset_version: ['18', '15'] ort_version: ['1.16.3'] + onnx_version: ['1.16.1'] + include: + - name: 'py38-tf2.9' + tf_version: '2.9.0' + python_version: '3.8' + - name: 'py39-tf2.9' + tf_version: '2.9.0' + python_version: '3.9' + - name: 'py39-tf2.15' + tf_version: '2.15.0' + python_version: '3.9' + - name: 'py310-tf2.15' + tf_version: '2.15.0' + python_version: '3.10' + - name: 'py37-tf1.15' + tf_version: '1.15.5' + python_version: '3.7' + os: 'ubuntu-latest' + opset_version: '15' + ort_version: '1.14.1' + onnx_version: '1.14.1' runs-on: ubuntu-latest @@ -33,7 +62,7 @@ jobs: shell: bash run: | chmod +x ./tests/utils/setup_test_env.sh - ./tests/utils/setup_test_env.sh ${{ matrix.tf_version }} ${{ matrix.ort_version }} + ./tests/utils/setup_test_env.sh ${{ matrix.tf_version }} ${{ matrix.ort_version }} ${{ matrix.onnx_version }} - name: Fix Paths (Windows only) if: runner.os == 'Windows' diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 8e6d09c64..6586126ea 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,4 +1,4 @@ -name: Pylint Workflow +name: Pylint on: pull_request: diff --git a/.github/workflows/unit_tests_core.yml b/.github/workflows/unit_tests_ci.yml similarity index 68% rename from .github/workflows/unit_tests_core.yml rename to .github/workflows/unit_tests_ci.yml index d95a77504..6239f8aed 100644 --- a/.github/workflows/unit_tests_core.yml +++ b/.github/workflows/unit_tests_ci.yml @@ -1,4 +1,4 @@ -name: Unit Tests (CI) +name: Unit Test (CI) on: pull_request: @@ -9,15 +9,46 @@ on: - main workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} + cancel-in-progress: true + jobs: run_tests: strategy: + fail-fast: false matrix: - tf_version: ['2.9.0', '2.13.0'] - python_version: ['3.8', '3.9'] + name: + - 'py38-tf2.9' + - 'py39-tf2.10' + - 'py39-tf2.15' + - 'py310-tf2.15' + os: ['ubuntu-latest', 'windows-2022'] opset_version: ['18', '15'] ort_version: ['1.16.3'] - os: ['ubuntu-latest', 'windows-2022'] + onnx_version: ['1.16.1'] + skip_tflite: ['False'] + include: + - name: 'py38-tf2.9' + tf_version: '2.9.0' + python_version: '3.8' + - name: 'py39-tf2.10' + tf_version: '2.10.0' + python_version: '3.9' + - name: 'py39-tf2.15' + tf_version: '2.15.0' + python_version: '3.9' + - name: 'py310-tf2.15' + tf_version: '2.15.0' + python_version: '3.10' + - name: 'py37-tf1.15' + tf_version: '1.15.5' + python_version: '3.7' + os: 'ubuntu-latest' + opset_version: '15' + ort_version: '1.14.1' + onnx_version: '1.14.1' + skip_tflite: 'True' runs-on: ${{ matrix.os }} @@ -34,7 +65,7 @@ jobs: shell: bash run: | chmod +x ./tests/utils/setup_test_env.sh - ./tests/utils/setup_test_env.sh ${{ matrix.tf_version }} ${{ matrix.ort_version }} + ./tests/utils/setup_test_env.sh ${{ matrix.tf_version }} ${{ matrix.ort_version }} ${{ matrix.onnx_version }} - name: Fix Paths (Windows only) if: runner.os == 'Windows' @@ -49,7 +80,7 @@ jobs: run: | export TF2ONNX_TEST_BACKEND=onnxruntime export TF2ONNX_TEST_OPSET=${{ matrix.opset_version }} - export TF2ONNX_SKIP_TFLITE_TESTS=False + export TF2ONNX_SKIP_TFLITE_TESTS=${{ matrix.skip_tflite }} export TF2ONNX_SKIP_TFJS_TESTS=True export TF2ONNX_SKIP_TF_TESTS=False python -m pytest --cov=tf2onnx --cov-report=term --disable-pytest-warnings -r s tests --cov-append --junitxml=junit/test-results.xml @@ -60,7 +91,7 @@ jobs: run: | set TF2ONNX_TEST_BACKEND=onnxruntime set TF2ONNX_TEST_OPSET=${{ matrix.opset_version }} - set TF2ONNX_SKIP_TFLITE_TESTS=False + set TF2ONNX_SKIP_TFLITE_TESTS=${{ matrix.skip_tflite }} set TF2ONNX_SKIP_TFJS_TESTS=True set TF2ONNX_SKIP_TF_TESTS=False python -m pytest --cov=tf2onnx --cov-report=term --disable-pytest-warnings -r s tests --cov-append --junitxml=junit/test-results.xml diff --git a/tests/utils/setup_test_env.sh b/tests/utils/setup_test_env.sh index 004f2505b..a14828d05 100755 --- a/tests/utils/setup_test_env.sh +++ b/tests/utils/setup_test_env.sh @@ -1,22 +1,24 @@ #!/bin/bash # # Check if the argument is provided -if [ "$#" -ne 2 ]; then - echo "Usage: $0 " +if [ "$#" -ne 3 ]; then + echo "Usage: $0 " exit 1 fi # Assign the argument to a variable TF_VERSION=$1 ORT_VERSION=$2 +ONNX_VERSION=$3 echo "==== TensorFlow version: $TF_VERSION" echo "==== ONNXRuntime version: $ORT_VERSION" +echo "==== ONNX version: $ONNX_VERSION" pip install pytest pytest-cov pytest-runner coverage graphviz requests pyyaml pillow pandas parameterized sympy coloredlogs flatbuffers timeout-decorator -pip install onnx +pip install onnx==$ONNX_VERSION pip install onnxruntime==$ORT_VERSION -pip install numpy +pip install "numpy<2" pip install onnxruntime-extensions pip install "tensorflow-text<=$TF_VERSION"