diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f38cb85 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +# Build DSIronPython package using msbuild +name: DSIronPython-VS2022Build +on: [push, pull_request, workflow_dispatch] +jobs: + build: + runs-on: windows-2022 + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + path: DSIronPython + repository: DynamoDS/DSIronPython + - name: Setup nuget + uses: nuget/setup-nuget@v1.2 + - name: Setup msbuild + uses: microsoft/setup-msbuild@v1.3.1 + - name: Nuget Restore DSIronPython solution + run: nuget restore ${{ github.workspace }}\DSIronPython\DSIronPython.sln + - name: Build DSIronPython with MSBuild + run: | + Write-Output "***Continue with the build, Good luck developer!***" + msbuild ${{ github.workspace }}\DSIronPython\DSIronPython.sln + - name: Look for package + run: | + Write-Output "***Locating iron python package!***" + if (Test-Path -Path "${{ github.workspace }}\DSIronPython\package_output\DSIronPython\extra\DSIronPython.dll") { + Write-Output "python node dll exists!" + } else { + Write-Error "python node dll was not found!" + } + - name: Run test with the dotnet CLI + run: | + dotnet test ${{ github.workspace }}\DSIronPython --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DSIronPython\TestResults + - name: Upload build artifact + uses: actions/upload-artifact@v3.1.3 + with: + name: DSIronPython + path: ${{ github.workspace }}\DSIronPython\package_output + retention-days: 7 + - name: Upload test artifact + uses: actions/upload-artifact@v3.1.3 + with: + name: TestResults + path: ${{ github.workspace }}\DSIronPython\TestResults + retention-days: 1 diff --git a/.github/workflows/publish_test_report.yml b/.github/workflows/publish_test_report.yml new file mode 100644 index 0000000..1cb9adb --- /dev/null +++ b/.github/workflows/publish_test_report.yml @@ -0,0 +1,25 @@ +name: Publish Test Report + +on: + workflow_run: + workflows: + - DSIronPython-VS2022Build + types: + - completed + +permissions: + contents: read + actions: read + checks: write + +jobs: + publish_test_report: + name: Publish Test Report + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1.7.0 + with: + artifact: TestResults + name: Test Results + path: '*.trx' + reporter: dotnet-trx diff --git a/.gitignore b/.gitignore index 9491a2f..d4d380b 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ bld/ [Oo]ut/ [Ll]og/ [Ll]ogs/ +package_output/ # Visual Studio 2015/2017 cache/options directory .vs/ @@ -360,4 +361,4 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd diff --git a/IronPythonExtension/IronPythonExtension.cs b/IronPythonExtension/IronPythonExtension.cs index 17f3f68..6c08bf4 100644 --- a/IronPythonExtension/IronPythonExtension.cs +++ b/IronPythonExtension/IronPythonExtension.cs @@ -86,10 +86,6 @@ public void Ready(ReadyParams rp) hwm.Run(); } } - - /// - /// Action to be invoked when shutdown has begun. - /// public void Shutdown() { // Do nothing for now @@ -138,6 +134,8 @@ private static void LoadPythonEngine(Assembly assembly) throw new Exception($"Failed to add a Python engine from assembly {assembly.GetName().Name}.dll with error: {ex.Message}"); } } + + } internal class IsolatedPythonContext : AssemblyLoadContext {