Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
xadupre committed May 20, 2024
2 parents fc57c31 + efc2b67 commit 40e4ee5
Show file tree
Hide file tree
Showing 13 changed files with 254 additions and 197 deletions.
89 changes: 0 additions & 89 deletions .azure-pipelines/linux-conda-CI.yml

This file was deleted.

46 changes: 20 additions & 26 deletions .azure-pipelines/nightly-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
matrix:
Python382:
python.version: '3.8'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.13.0

Python391:
python.version: '3.9'
ONNX_PATH: onnx==1.9.0
ONNX_PATH: onnx==1.13.0

Python392:
python.version: '3.9'
ONNX_PATH: onnx==1.10.2
ONNX_PATH: onnx==1.13.0

Python310:
python.version: '3.10'
Expand All @@ -32,26 +32,27 @@ jobs:
- script: sudo install -d -m 0777 /home/vsts/.conda/envs
displayName: Fix Conda permissions

- task: CondaEnvironment@1
- task: UsePythonVersion@0
inputs:
createCustomEnvironment: true
environmentName: 'py$(python.version)'
packageSpecs: 'python=$(python.version)'
versionSpec: '$(python.version)'
addToPath: true
architecture: 'x64'
displayName: 'Use Python $(python.version)'

- script: |
python -m pip install --upgrade pip
conda config --set always_yes yes --set changeps1 no
conda install -c conda-forge protobuf
conda install -c conda-forge numpy
pip install protobuf
pip install numpy
pip install -r requirements.txt
# install ORT dependencies
pip install onnxruntime
# replace with ort-nightly
pip uninstall -y onnxruntime
pip install --index-url https://test.pypi.org/simple/ ort-nightly
pip install $(ONNX_PATH)
pip install protobuf==3.20.2
pip install protobuf>=3.20.2
pip install pytest
pip install onnxmltools
pip install -e .
displayName: 'Install dependencies'
Expand All @@ -62,7 +63,7 @@ jobs:
- script: |
python -c "import onnxconverter_common"
pytest tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest - onnxutils'
- task: PublishTestResults@2
Expand All @@ -78,19 +79,19 @@ jobs:
matrix:
Python382:
python.version: '3.8'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.13

Python391:
python.version: '3.9'
ONNX_PATH: onnx==1.9.0
ONNX_PATH: onnx==1.13

Python392:
python.version: '3.9'
ONNX_PATH: onnx==1.10.2
ONNX_PATH: onnx==1.13

Python310:
python.version: '3.10'
ONNX_PATH: onnx==1.14.0
ONNX_PATH: onnx==1.14

maxParallel: 4

Expand All @@ -100,14 +101,7 @@ jobs:
versionSpec: '$(python.version)'
architecture: 'x64'

- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH

- script: conda create --yes --quiet --name py$(python.version) -c conda-forge python=$(python.version) numpy protobuf
displayName: Create Anaconda environment

- script: |
call activate py$(python.version)
python -m pip install --upgrade pip numpy
echo Test numpy installation... && python -c "import numpy"
pip install -r requirements.txt
Expand All @@ -117,20 +111,20 @@ jobs:
pip uninstall -y onnxruntime
pip install --index-url https://test.pypi.org/simple/ ort-nightly
pip install %ONNX_PATH%
pip install protobuf==3.20.2
pip install protobuf>=3.20.2
pip install pytest
pip install onnxmltools
pip install -e .
displayName: 'Install dependencies'
- script: |
call activate py$(python.version)
pip install flake8
python -m flake8 onnxconverter_common
displayName: 'run flake8 check'
- script: |
call activate py$(python.version)
pytest tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest - onnxutils'
- task: PublishTestResults@2
Expand Down
67 changes: 0 additions & 67 deletions .azure-pipelines/win32-conda-CI.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/linux-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
test_matrix:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
include:
- python-version: "3.8"
onnx-version: 1.16
- python-version: "3.9"
onnx-version: 1.16
- python-version: "3.10"
onnx-version: 1.16


steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install onnxruntime
pip install onnxmltools
pip install onnx==${{ matrix.onnx-version }}
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
52 changes: 52 additions & 0 deletions .github/workflows/windows-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
test_matrix:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
include:
- python-version: "3.8"
onnx-version: 1.16
- python-version: "3.9"
onnx-version: 1.16
- python-version: "3.10"
onnx-version: 1.16

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install onnxruntime
pip install onnxmltools
pip install onnx==${{ matrix.onnx-version }}
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
Loading

0 comments on commit 40e4ee5

Please sign in to comment.