name: Mainon:push:branches:- masterpull_request:jobs:build-test:name: Build and Testruns-on: ${{ matrix.os.instance }}timeout-minutes: 15strategy:fail-fast: falsematrix:os:- category: windowsplatform: x86instance: windows-latest- category: windowsplatform: x64instance: windows-latest- category: ubuntuplatform: x64instance: ubuntu-latest- category: macosplatform: x64instance: macos-13python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]steps:- name: Set Environment on macOSuses: maxim-lobanov/setup-xamarin@v1if: ${{ matrix.os.category == 'macos' }}with:mono-version: latest- name: Checkout codeuses: actions/checkout@v2- name: Setup .NETuses: actions/setup-dotnet@v1with:dotnet-version: '6.0.x'- name: Set up Python ${{ matrix.python }}uses: actions/setup-python@v2with:python-version: ${{ matrix.python }}architecture: ${{ matrix.os.platform }}- name: Install dependenciesrun: |pip install --upgrade -r requirements.txtpip install numpy # for tests- name: Build and Installrun: |pip install -v .- name: Set Python DLL path and PYTHONHOME (non Windows)if: ${{ matrix.os.category != 'windows' }}run: |echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENVecho PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV- name: Set Python DLL path and PYTHONHOME (Windows)if: ${{ matrix.os.category == 'windows' }}run: |Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)"Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')"- name: Embedding testsrun: dotnet test --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/embed_tests/env:MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466- name: Python Tests (Mono)if: ${{ matrix.os.category != 'windows' }}run: pytest --runtime mono# TODO: Run these tests on Windows x86- name: Python Tests (.NET Core)if: ${{ matrix.os.platform == 'x64' }}run: pytest --runtime coreclr- name: Python Tests (.NET Framework)if: ${{ matrix.os.category == 'windows' }}run: pytest --runtime netfx- name: Python tests run from .NETrun: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/- name: Perf testsif: ${{ (matrix.python == '3.8') && (matrix.os.platform == 'x64') }}run: |pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2dotnet test --configuration Release --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/perf_tests/# TODO: Run mono tests on Windows?
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。