@@ -2,9 +2,9 @@ name: Build and Test
2
2
3
3
on :
4
4
push :
5
- branches : [ "develop " ]
5
+ branches : [ "test_pir " ]
6
6
pull_request :
7
- branches : [ "develop " ]
7
+ branches : [ "test_pir " ]
8
8
9
9
permissions :
10
10
contents : read
@@ -15,20 +15,19 @@ jobs:
15
15
strategy :
16
16
matrix :
17
17
python-version : [ '3.8']
18
- architecture : [ 'x64' ]
19
-
18
+ architecture : [ 'x86_64']
20
19
steps :
21
20
# Checkout the latest branch of Paddle2ONNX.
22
21
- name : Checkout Paddle2ONNX
23
22
uses : actions/checkout@v4
24
23
with :
25
24
submodules : true
26
25
27
- - name : Build on manylinux2014_x86_64
28
- uses : docker://quay.io/pypa/manylinux2014_x86_64 :latest
26
+ - name : Build on manylinux_2_28_x86_64
27
+ uses : docker://quay.io/pypa/manylinux_2_28_x86_64 :latest
29
28
with :
30
29
entrypoint : bash
31
- args : .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }} manylinux2014_x86_64 CentOS
30
+ args : .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }}
32
31
33
32
- name : Setup Python 3.8
34
33
uses : actions/setup-python@v5
@@ -50,49 +49,62 @@ jobs:
50
49
runs-on : windows-2019
51
50
strategy :
52
51
matrix :
53
- python-version : [ '3.8 ' ]
52
+ python-version : [ '3.10 ' ]
54
53
architecture : [ 'x64' ]
55
54
56
55
steps :
57
- # Checkout the latest branch of Paddle2ONNX.
58
- - name : Checkout Paddle2ONNX
59
- uses : actions/checkout@v4
60
- with :
61
- submodules : true
62
-
63
- # Download and extract protobuf
64
- - name : Download and extract protobuf
65
- run : |
66
- curl -L -o protobuf.zip https://bj.bcebos.com/fastdeploy/third_libs/protobuf-win-x64-3.16.0.zip
67
- powershell -Command "Expand-Archive -Path protobuf.zip -DestinationPath $PWD/protobuf"
68
-
69
- # Setup Python
70
- - name : Set up Python ${{ matrix.python-version }}
71
- uses : actions/setup-python@v5
72
- with :
73
- python-version : ${{ matrix.python-version }}
74
- # Install Python dependencies
75
- - name : Install Python dependencies
76
- run : |
77
- python -m pip install -q --upgrade pip
78
- python -m pip install setuptools wheel auditwheel auditwheel-symbols build
79
-
80
- # Build package
81
- - name : Build package
82
- run : |
83
- $Env:PATH = "${{ github.workspace }}\protobuf\bin;" + $Env:PATH
84
- python -m build --wheel
85
-
86
- # Install Paddle2ONNX
87
- - name : Install Paddle2ONNX
88
- run : |
89
- Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname}
90
-
91
- # Install Test
92
- - name : Run Test
93
- working-directory : ./tests
94
- run : |
95
- .\run.bat python
56
+ # Checkout the latest branch of Paddle2ONNX.
57
+ - name : Checkout Paddle2ONNX
58
+ uses : actions/checkout@v4
59
+ with :
60
+ submodules : true
61
+
62
+ # Clone protobuf repository and checkout to v21.12
63
+ - name : Clone protobuf
64
+ run : |
65
+ git clone https://github.com/protocolbuffers/protobuf.git
66
+ cd protobuf
67
+ git checkout v21.12
68
+
69
+ # Build and install protobuf
70
+ - name : Build and install protobuf
71
+ run : |
72
+ cd protobuf
73
+ git submodule update --init --recursive
74
+ mkdir build
75
+ cd build
76
+ cmake -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\protobuf\protobuf_install\ -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF ..
77
+ cmake --build . --config Release --target install
78
+
79
+ # Setup Python
80
+ - name : Set up Python ${{ matrix.python-version }}
81
+ uses : actions/setup-python@v5
82
+ with :
83
+ python-version : ${{ matrix.python-version }}
84
+
85
+ # Install Python dependencies
86
+ - name : Install Python dependencies
87
+ run : |
88
+ python -m pip install -q --upgrade pip
89
+ python -m pip install setuptools wheel auditwheel auditwheel-symbols build
90
+
91
+ # Build package
92
+ - name : Build package
93
+ run : |
94
+ $Env:PATH = "${{ github.workspace }}\protobuf\protobuf_install\bin;" + $Env:PATH
95
+ $Env:PIP_EXTRA_INDEX_URL="https://www.paddlepaddle.org.cn/packages/nightly/cpu/"
96
+ python -m build --wheel
97
+
98
+ # Install Paddle2ONNX
99
+ - name : Install Paddle2ONNX
100
+ run : |
101
+ Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname}
102
+
103
+ # Install Test
104
+ - name : Run Test
105
+ working-directory : ./tests
106
+ run : |
107
+ .\run.bat python
96
108
97
109
build_on_macos :
98
110
# Use MACOSX_DEPLOYMENT_TARGET=12.0 to produce compatible wheel
@@ -103,7 +115,6 @@ jobs:
103
115
matrix :
104
116
python-version : [ '3.8']
105
117
architecture : [ 'arm64' ]
106
-
107
118
steps :
108
119
# Checkout the latest branch of Paddle2ONNX.
109
120
- name : Checkout Paddle2ONNX
@@ -117,10 +128,22 @@ jobs:
117
128
with :
118
129
python-version : ${{ matrix.python-version }}
119
130
120
- # Download protobuf
121
- - name : Download protobuf
131
+ # Clone protobuf repository and checkout to v21.12
132
+ - name : Clone protobuf
133
+ run : |
134
+ git clone https://github.com/protocolbuffers/protobuf.git
135
+ cd protobuf
136
+ git checkout v21.12
137
+
138
+ # Build and install protobuf
139
+ - name : Build and install protobuf
122
140
run : |
123
- source .github/workflows/scripts/download_protobuf.sh
141
+ cd protobuf
142
+ git submodule update --init --recursive
143
+ mkdir build
144
+ cd build
145
+ cmake ../cmake -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/installed_protobuf -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14
146
+ cmake --build . --target install
124
147
125
148
# Install Python dependencies
126
149
- name : Install Python dependencies
@@ -132,6 +155,7 @@ jobs:
132
155
- name : Build package
133
156
run : |
134
157
export PATH="${{ github.workspace }}/installed_protobuf/bin:$PATH"
158
+ export PIP_EXTRA_INDEX_URL="https://www.paddlepaddle.org.cn/packages/nightly/cpu/"
135
159
python -m build --wheel
136
160
137
161
# Install Paddle2ONNX
0 commit comments