Skip to content

LinuxRelease_x86_64 #33

LinuxRelease_x86_64

LinuxRelease_x86_64 #33

name: LinuxRelease_x86_64
on:
schedule:
# Run weekly on Monday 00:00
- cron: '00 00 * * MON'
push:
branches: [main, rel-*]
pull_request:
branches: [main, rel-*]
workflow_dispatch:
permissions: # set top-level default permissions as security best practice
contents: read
jobs:
build:
if: github.event_name != 'pull_request' || startsWith( github.base_ref, 'rel-') || contains( github.event.pull_request.labels.*.name, 'run release CIs')
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
architecture: ['x64']
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@3faddefb4c02470d61266571df739b19e3a006be
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install python dependencies
run: |
python -m pip install -q --upgrade pip
python -m pip install -q -r requirements-release.txt
- name: Build manylinux2014_x86_64
uses: docker://quay.io/pypa/manylinux2014_x86_64
with:
entrypoint: bash
args: .github/workflows/manylinux/entrypoint.sh ${{ matrix.python-version }} manylinux2014_x86_64 ${{ github.event_name }}
- name: Install protobuf in the GitHub Action environment for testing the wheel
run: |
source workflow_scripts/protobuf/build_protobuf_unix.sh $(nproc)
- name: Test wheel with Python ${{ matrix.python-version }}
run: |
python -m pip install dist/*manylinux2014_x86_64.whl
pytest
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: wheels
path: dist
- name: Upload wheel to TestPyPI/PyPI weekly
if: (github.event_name == 'schedule') # Only triggered by weekly event
run: |
twine upload --verbose dist/*.whl --repository-url https://upload.pypi.org/legacy/ -u ${{ secrets.ONNXWEEKLY_USERNAME }} -p ${{ secrets.ONNXWEEKLY_TOKEN }}
# TODO: stop uploading to TestPyPI after future ONNX 1.14
twine upload --verbose dist/*.whl --repository-url https://test.pypi.org/legacy/ -u ${{ secrets.TESTPYPI_USERNAME }} -p ${{ secrets.TESTPYPI_PASSWORD }}
TEST_HUB=1 pytest
- name: Verify ONNX with the latest numpy
if: ${{ always() }}
run: |
python -m pip uninstall -y numpy onnx && python -m pip install numpy
python -m pip install dist/*manylinux2014_x86_64.whl
pytest
- name: Verify ONNX with the latest protobuf
if: ${{ always() }}
run: |
python -m pip uninstall -y protobuf onnx && python -m pip install protobuf
python -m pip install dist/*manylinux2014_x86_64.whl
pytest
- name: Verify ONNX with the minimum supported protobuf (from requirements.txt)
if: ${{ always() }}
run: |
python -m pip uninstall -y protobuf onnx && python -m pip install protobuf==3.20.2
python -m pip install dist/*manylinux2014_x86_64.whl
pytest
- name: Verify ONNX with ONNX Runtime PyPI package
if: matrix.python-version != '3.11'
run: |
python -m pip uninstall -y onnx protobuf numpy && python -m pip install -q -r requirements-release.txt
python -m pip install dist/*manylinux2014_x86_64.whl
python -m pip install -q onnxruntime
export ORT_MAX_IR_SUPPORTED_VERSION=8
export ORT_MAX_ML_OPSET_SUPPORTED_VERSION=3
export ORT_MAX_ONNX_OPSET_SUPPORTED_VERSION=18
pytest