【Hackathon 7th No.48】Paddle2ONNX 添加对 Windows 平台自动发包机制的支持 -part #455
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: [ "develop" ] | |
pull_request: | |
branches: [ "develop" ] | |
permissions: | |
contents: read | |
jobs: | |
build_on_linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.8'] | |
architecture: [ 'x64' ] | |
steps: | |
# Checkout the latest branch of Paddle2ONNX. | |
- name: Checkout Paddle2ONNX | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Build on manylinux2014_x86_64 | |
uses: docker://quay.io/pypa/manylinux2014_x86_64:latest | |
with: | |
entrypoint: bash | |
args: .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }} manylinux2014_x86_64 CentOS | |
- name: Setup Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
# Install Paddle2ONNX | |
- name: Install Paddle2ONNX | |
run: | | |
python -m pip install dist/*.whl | |
# Install Test | |
- name: Run Test | |
working-directory: ./tests | |
run: | | |
bash run.sh python | |
build_on_windows: | |
runs-on: windows-2019 | |
strategy: | |
matrix: | |
python-version: [ '3.8' ] | |
architecture: [ 'x64' ] | |
steps: | |
# Checkout the latest branch of Paddle2ONNX. | |
- name: Checkout Paddle2ONNX | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# Download and extract protobuf | |
- name: Download and extract protobuf | |
run: | | |
curl -L -o protobuf.zip https://bj.bcebos.com/fastdeploy/third_libs/protobuf-win-x64-3.16.0.zip | |
powershell -Command "Expand-Archive -Path protobuf.zip -DestinationPath $PWD/protobuf" | |
# Setup Python | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.architecture }} | |
# Install Python dependencies | |
- name: Install Python dependencies | |
run: | | |
python -m pip install -q --upgrade pip | |
python -m pip install setuptools wheel auditwheel auditwheel-symbols build | |
# Build package | |
- name: Build package | |
run: | | |
$Env:PATH = "${{ github.workspace }}\protobuf\bin;" + $Env:PATH | |
python -m build --wheel | |
# Install Paddle2ONNX | |
- name: Install Paddle2ONNX | |
run: | | |
Get-ChildItem -Path dist/*.whl | foreach {python -m pip install --upgrade $_.fullname} | |
# Install Test | |
- name: Run Test | |
working-directory: ./tests | |
run: | | |
.\run.bat python |