diff --git a/.github/workflows/ARM.yml b/.github/workflows/ARM.yml index eef0e666d..e436c009e 100644 --- a/.github/workflows/ARM.yml +++ b/.github/workflows/ARM.yml @@ -4,7 +4,7 @@ on: push: branches: - master - pull_request: + # pull_request: jobs: build-test-arm: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 5b782c8b4..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Documentation - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Doxygen Action - uses: mattnotmitt/doxygen-action@1.9.4 - with: - working-directory: "doc/" - - - name: Build Sphinx documentation - run: | - pip install -r doc/requirements.txt - sphinx-build doc/source/ ./doc/build/html/ - - - name: Upload artifact - # Automatically uploads an artifact from the './_site' directory by default - uses: actions/upload-pages-artifact@v1 - with: - path: doc/build/html/ - - deploy: - if: github.ref == 'refs/heads/master' - runs-on: ubuntu-latest - permissions: - contents: read - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..2a4a74f11 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,106 @@ +name: Main + +on: + push: + branches: + - dynamo_py3 + pull_request: + +jobs: + build-test: + name: Build and Test + runs-on: ${{ matrix.os.instance }} + timeout-minutes: 15 + + strategy: + fail-fast: false + matrix: + os: + - category: windows + platform: x86 + instance: windows-latest + + - category: windows + platform: x64 + instance: windows-latest + + - category: ubuntu + platform: x64 + instance: ubuntu-22.04 + + - category: macos + platform: x64 + instance: macos-13 + + python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Set Environment on macOS + uses: maxim-lobanov/setup-xamarin@v1 + if: ${{ matrix.os.category == 'macos' }} + with: + mono-version: latest + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + architecture: ${{ matrix.os.platform }} + + - name: Install dependencies + run: | + pip install --upgrade -r requirements.txt + pip install numpy # for tests + + - name: Build and Install + run: | + 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_ENV + echo 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 tests + run: 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 .NET + run: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/ + + # - name: Perf tests + # if: ${{ (matrix.python == '3.8') && (matrix.os.platform == 'x64') }} + # run: | + # pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2 + # dotnet test --configuration Release --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/perf_tests/ + + # TODO: Run mono tests on Windows? diff --git a/.github/workflows/nuget-preview.yml b/.github/workflows/nuget-preview.yml new file mode 100644 index 000000000..7cffbf07b --- /dev/null +++ b/.github/workflows/nuget-preview.yml @@ -0,0 +1,64 @@ +name: NuGet Preview Release + +on: + push: + branches: + - dynamo_py3 + workflow_dispatch: + +jobs: + release: + name: Release Preview + runs-on: ubuntu-latest + environment: NuGet + timeout-minutes: 10 + + env: + PYTHONNET_SHUTDOWN_MODE: Normal + + steps: + - name: Get Date + run: | + echo "DATE_VER=$(date "+%Y-%m-%d")" >> $GITHUB_ENV + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + architecture: x64 + + - name: Install dependencies + run: | + pip install --upgrade -r requirements.txt + pip install numpy # for tests + + - name: Build and Install + run: | + pip install -v . + + - name: Set Python DLL path (non Windows) + if: ${{ matrix.os != 'windows' }} + run: | + echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV + + - name: Python Tests + run: pytest + + - name: Embedding tests + run: dotnet test --runtime any-ubuntu src/embed_tests/ + + - name: Pack + run: dotnet pack --configuration Release --version-suffix preview${{env.DATE_VER}} --output "Release-Preview" + + - name: Publish NuGet + run: | + dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_MONTHLY }} Release-Preview/*.nupkg + dotnet nuget push --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_MONTHLY }} Release-Preview/*.snupkg diff --git a/nuget.config b/nuget.config deleted file mode 100644 index ea1faadee..000000000 --- a/nuget.config +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/pipeline.yml b/pipeline.yml index 6a0c42fbb..ee349db01 100644 --- a/pipeline.yml +++ b/pipeline.yml @@ -1,26 +1,6 @@ version: 3.1.0 pipeline_os: linux main_branch: dynamo_py3 -update_changelog_on_release: true -create_github_release: true -create_pr_release_to_master: true - -env: - - GITHUB_ACCESS_TOKEN_ID: github_access_token_acsbuildguy - # - SLACK_QUANTUM_BUILD_CHANNEL: dynamo-vera-notify - -jenkins_creds: - - - type: secretText - credentialsId: svc_d_dyntest-apikey-artifactory-dynamo-team-nuget - secretText: API_KEY - -# code_analysis: -# sonarqube: -# source_encoding: UTF-8 -# src: . -# coverage_reports: -# - coverage.info build: - @@ -30,30 +10,6 @@ build: scripts: - scripts/install.sh -ci_test: - tests: - - - customized_builder_image: - registry: artifactory - url: artifactory.dev.adskengineer.net/dynamo/pythonnet-build:2.0.1 - scripts: - - scripts/install.sh - - scripts/test.sh - - publish_html_reports: - - - report_name: Embed Tests - report_index_file: src/embed_tests/TestResults/embed_tests-output.html - report_dir: . - - - report_name: Module Tests - report_index_file: src/module_tests/TestResults/module_tests-output.html - report_dir: . - - - report_name: Python Tests Runner - report_index_file: src/python_tests_runner/TestResults/python_tests_runner-output.html - report_dir: . - soc2: harmony: allow_branches: @@ -63,25 +19,3 @@ soc2: third_party_lib_paths: - build\lib\pythonnet\runtime analyze_results : true - -deployment: - # CILibrary doesn't yet support signing on Linux. I tried to get this going, but haven't figured it out yet. See the vera/nuget-deploy branch on the CILibrary repo. - # - - # type: sign - # files_to_sign: - # - pythonnet/runtime/Python.Runtime.dll - - - type: customized - allow_branches: dynamo_py3 - customized_builder_image: - registry: artifactory - url: artifactory.dev.adskengineer.net/dynamo/pythonnet-build:2.0.1 - scripts: - - dotnet pack --configuration Release --version-suffix preview-ADSK-$(date +%s) --output "Release-Preview" - - dotnet nuget push --source "Dynamo Artifactory" --api-key ${API_KEY} Release-Preview/*.nupkg - - dotnet nuget push --skip-duplicate --source "Dynamo Artifactory" --api-key ${API_KEY} Release-Preview/*.snupkg - - - - type: github - outputs: - - build\lib\pythonnet\runtime\Python.Runtime.dll diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index ff11a1ef8..000000000 --- a/scripts/test.sh +++ /dev/null @@ -1,15 +0,0 @@ -export PYTHONNET_PYDLL=$(python3 -m find_libpython) - -dotnet test --logger "html;verbosity=detailed;logfilename=embed_tests-output.html" -p:targetframeworks=net6.0 src/embed_tests/ -retVal=$? - -dotnet test --logger "html;verbosity=detailed;logfilename=module_tests-output.html" -p:targetframeworks=net6.0 src/module_tests/ -retVal=$(($retVal || $?)) - -python3 -m pytest --runtime coreclr -retVal=$(($retVal || $?)) - -dotnet test --logger "html;verbosity=detailed;logfilename=python_tests_runner-output.html" -p:targetframeworks=net6.0 src/python_tests_runner/ -retVal=$(($retVal || $?)) - -exit $retVal