forked from onnx/onnx
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (91 loc) · 3.82 KB
/
release_linux_x86_64.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
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
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
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.8', '3.9', '3.10', '3.11', '3.12']
architecture: ['x64']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- 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: Build manylinux2014_x86_64
uses: docker://quay.io/pypa/manylinux2014_x86_64:latest
with:
entrypoint: bash
args: .github/workflows/manylinux/entrypoint.sh ${{ matrix.python-version }} manylinux2014_x86_64 ${{ github.event_name }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
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: 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: wheels
path: dist
- name: Upload wheel to 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 }}
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 minimumly supported packages
if: ${{ always() }}
run: |
python -m pip uninstall -y numpy protobuf onnx && python -m pip install -r requirements-min.txt
python -m pip install dist/*manylinux2014_x86_64.whl
pytest
- name: Verify ONNX with ONNX Runtime PyPI package
if: matrix.python-version != '3.12'
run: |
python -m pip uninstall -y protobuf numpy && python -m pip install -q -r requirements-release.txt
python -m pip install -q onnxruntime==1.17.3
export ORT_MAX_IR_SUPPORTED_VERSION=9
export ORT_MAX_ML_OPSET_SUPPORTED_VERSION=3
export ORT_MAX_ONNX_OPSET_SUPPORTED_VERSION=20
pytest