Skip to content

Move docs coverage pages into docs/coverage/ subfolder #4052

Move docs coverage pages into docs/coverage/ subfolder

Move docs coverage pages into docs/coverage/ subfolder #4052

Workflow file for this run

name: ci-3-tensorflow
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "0 4 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
detect_tensorflow_scope:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/common_detect_module_scope.yml
permissions:
contents: read
with:
module: tensorflow
base_sha: ${{ github.event.pull_request.base.sha }}
head_sha: ${{ github.event.pull_request.head.sha }}
tensorflow_targeted_tests:
name: tensorflow targeted (py3.13, tf-2.21, jax-0.10)
needs: detect_tensorflow_scope
if: needs.detect_tensorflow_scope.outputs.count == '1'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install tensorflow==2.21 jax==0.10
run: pip install "tensorflow==2.21.*" "jax==0.10.*"
- name: Install dependencies
run: pip install -e ".[dev,tensorflow]"
- name: Install tensorflow==2.21 jax==0.10 again
run: pip install "tensorflow==2.21.*" "jax==0.10.*"
- name: pip freeze
run: pip freeze
- name: Run targeted tensorflow tests
run: pytest --durations=10 unittests/tensorflow
tensorflow_tests:
name: tensorflow (ubuntu-latest, py${{ matrix.python-version }}, tf-${{ matrix.tensorflow-version }}, jax-${{ matrix.jax-version }})
needs: tensorflow_targeted_tests
# Run when targeted tests succeeded or were skipped (not a PR / out-of-scope PR).
# Do NOT run when targeted tests failed.
if: >-
always() && (
needs.tensorflow_targeted_tests.result == 'success' ||
needs.tensorflow_targeted_tests.result == 'skipped'
)
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: ["3.13"]
jax-version: ["0.9", "0.10"]
tensorflow-version: ["2.20", "2.21"]
exclude:
- jax-version: "0.9"
tensorflow-version: "2.21"
- jax-version: "0.10"
tensorflow-version: "2.20"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tensorflow==${{ matrix.tensorflow-version }} jax==${{ matrix.jax-version }}
run: pip install "tensorflow==${{ matrix.tensorflow-version }}.*" "jax==${{ matrix.jax-version }}.*"
- name: Install dependencies
run: pip install -e ".[dev,tensorflow]"
- name: Install tensorflow==${{ matrix.tensorflow-version }} jax==${{ matrix.jax-version }} again
run: pip install "tensorflow==${{ matrix.tensorflow-version }}.*" "jax==${{ matrix.jax-version }}.*"
- name: Run tensorflow tests with coverage
run: |
pytest --cov=yobx --cov-report=xml --durations=10 \
--ignore=unittests/reference/test__inference_session_torch.py \
--ignore=unittests/reference/test_backend_torch_reference_evaluator.py \
--ignore=unittests/reference/test_torch_onnxruntime_evaluator.py \
--ignore=unittests/reference/test_torch_reference_evaluator.py \
--ignore=unittests/parity \
--ignore=unittests/sklearn \
--ignore=unittests/sql \
--ignore=unittests/torch
- name: Parity with tf2onnx
run: |
pip install tf2onnx
pytest --durations=10 unittests/parity/with_tf2onnx
- name: Parity with jax2onnx
run: |
pip install jax2onnx
pytest --durations=10 unittests/parity/with_jax2onnx
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: tensorflow