Skip to content

Update README.md (#1454) #472

Update README.md (#1454)

Update README.md (#1454) #472

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 }}
# 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
build_on_macos:
# Use MACOSX_DEPLOYMENT_TARGET=12.0 to produce compatible wheel
env:
MACOSX_DEPLOYMENT_TARGET: "12.0"
runs-on: macos-latest
strategy:
matrix:
python-version: [ '3.8']
architecture: [ 'arm64' ]
steps:
# Checkout the latest branch of Paddle2ONNX.
- name: Checkout Paddle2ONNX
uses: actions/checkout@v4
with:
submodules: true
# Setup Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Download protobuf
- name: Download protobuf
run: |
source .github/workflows/scripts/download_protobuf.sh
# Install Python dependencies
- name: Install Python dependencies
run: |
python -m pip install -q --upgrade pip
python -m pip install setuptools wheel build
# Build package
- name: Build package
run: |
export PATH="${{ github.workspace }}/installed_protobuf/bin:$PATH"
python -m build --wheel
# 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