From 3aa05f38bb4723eb636f0e25ef1d0beb8107630c Mon Sep 17 00:00:00 2001 From: Aabishkar KC Date: Wed, 20 Dec 2023 19:44:46 -0500 Subject: [PATCH] Update build workflow (#14798) * Update build workflow * update * Update DynamoCLI check in linux --- .github/workflows/build_dynamo_all_net8.0.yml | 4 +- .../build_dynamo_core_net6.0_linux.yml | 57 ++++++------ .../build_dynamo_core_net6.0_windows.yml | 86 ++++++++++--------- 3 files changed, 76 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build_dynamo_all_net8.0.yml b/.github/workflows/build_dynamo_all_net8.0.yml index fd899a34f61..1f3a2b0733c 100644 --- a/.github/workflows/build_dynamo_all_net8.0.yml +++ b/.github/workflows/build_dynamo_all_net8.0.yml @@ -47,9 +47,11 @@ jobs: if-no-files-found: warn retention-days: 3 - name: Save Pull Request Artifact + env: + PR_NUMBER: ${{ github.event.number }} run: | New-Item -Path ${{ github.workspace }}\pr -ItemType Directory -Force - ${{ github.event.number }}| Out-File -FilePath pr\pr_number.txt + $env:PR_NUMBER | Out-File -FilePath ${{ github.workspace }}\pr\pr_number.txt - name: Upload Pull Request Artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/build_dynamo_core_net6.0_linux.yml b/.github/workflows/build_dynamo_core_net6.0_linux.yml index 6fc4dc9c2b7..b13de7bc9ea 100644 --- a/.github/workflows/build_dynamo_core_net6.0_linux.yml +++ b/.github/workflows/build_dynamo_core_net6.0_linux.yml @@ -8,32 +8,31 @@ on: pull_request: jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout Dynamo Repo - uses: actions/checkout@v4 - with: - path: Dynamo - - name: Setup dotnet - uses: actions/setup-dotnet@v4 - - name: Disable problem matcher - run: echo "::remove-matcher owner=csc::" - - - name: Install dependencies for linux runtime - run: dotnet restore ${{ github.workspace }}/Dynamo/src/DynamoCore.sln -p:Platform=NET60_Linux --runtime=linux-x64 - - name: Build Dynamo with MSBuild for Linux - run: | - echo "***Continue with the build, Good luck developer!***" - dotnet build ${{ github.workspace }}/Dynamo/src/DynamoCore.sln -c Release /p:Platform=NET60_Linux - - name: Navigate to Dynamo Linux Folder - run: | - cd "${{ github.workspace }}/Dynamo/bin/NET60_Linux/Release" - echo "***Locating DynamoCLI for Linux!***" - test "./DynamoCLI.exe" && echo "DynamoCLI exists!" - - name: Run smoke tests - run: | - cd "${{ github.workspace }}/Dynamo/bin/NET60_Linux/Release" - echo "***Running Smoke tests on linux***" - #TODO unfortunately dotnet does not find any tests in this assembly. - #dotnet test DynamoCoreTests.dll --filter "TestCategory~UnitTest" + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Dynamo Repo + uses: actions/checkout@v4 + with: + path: Dynamo + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + - name: Disable problem matcher + run: echo "::remove-matcher owner=csc::" + - name: Install dependencies for linux runtime + run: dotnet restore ${{ github.workspace }}/Dynamo/src/DynamoCore.sln -p:Platform=NET60_Linux --runtime=linux-x64 + - name: Build Dynamo with MSBuild for Linux + run: | + echo "***Continue with the build, Good luck developer!***" + dotnet build ${{ github.workspace }}/Dynamo/src/DynamoCore.sln -c Release /p:Platform=NET60_Linux + - name: Look for DynamoCLI.exe + run: | + cd "${{ github.workspace }}/Dynamo/bin/NET60_Linux/Release" + echo "***Locating DynamoCLI for Linux!***" + test "./DynamoCLI.exe" && echo "DynamoCLI exists!" + - name: Run smoke tests + run: | + cd "${{ github.workspace }}/Dynamo/bin/NET60_Linux/Release" + echo "***Running Smoke tests on linux***" + #TODO unfortunately dotnet does not find any tests in this assembly. + #dotnet test DynamoCoreTests.dll --filter "TestCategory~UnitTest" diff --git a/.github/workflows/build_dynamo_core_net6.0_windows.yml b/.github/workflows/build_dynamo_core_net6.0_windows.yml index 4ad05649472..014ead2bb8d 100644 --- a/.github/workflows/build_dynamo_core_net6.0_windows.yml +++ b/.github/workflows/build_dynamo_core_net6.0_windows.yml @@ -8,44 +8,48 @@ on: pull_request: jobs: - build: - runs-on: windows-latest - steps: - - name: Checkout Dynamo Repo - uses: actions/checkout@v4 - with: - path: Dynamo - repository: DynamoDS/Dynamo - - name: Setup dotnet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '6.0.x' - - name: Disable problem matcher - run: echo "::remove-matcher owner=csc::" - - - name: Install dependencies for windows runtime - run: | - dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.sln /p:Configuration=Release --runtime=win-x64 - - name: Build Dynamo with MSBuild for Windows - run: | - echo "***Continue with the build, Good luck developer!***" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\" - .\MSBuild.exe $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.sln /p:Configuration=Release - # look for Dynamo - - name: Navigate to Dynamo Windows Folder - run: | - cd "$Env:GITHUB_WORKSPACE\Dynamo\bin\AnyCPU\Release" - echo "***Locating DynamoCLI for Windows!***" - test ".\DynamoCLI.exe" && echo "DynamoCLI exists!" - - name: Install dependencies for linux runtime - run: dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.sln -p:Platform=NET60_Linux --runtime=linux-x64 - - name: Build Dynamo with MSBuild for Linux - run: | - echo "***Continue with the build, Good luck developer!***" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\" - .\MSBuild.exe $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.sln /p:Configuration=Release /p:Platform=NET60_Linux - - name: Navigate to Dynamo Linux Folder - run: | - cd "$Env:GITHUB_WORKSPACE\Dynamo\bin\NET60_Linux\Release" - echo "***Locating DynamoCLI for Linux!***" - test ".\DynamoCLI.exe" && echo "DynamoCLI exists!" + build: + runs-on: windows-latest + steps: + - name: Checkout Dynamo Repo + uses: actions/checkout@v4 + with: + path: Dynamo + repository: DynamoDS/Dynamo + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.x' + - name: Disable problem matcher + run: Write-Output "::remove-matcher owner=csc::" + - name: Setup msbuild + uses: microsoft/setup-msbuild@v1.3 + - name: Install dependencies for windows runtime + run: | + dotnet restore ${{ github.workspace }}\Dynamo\src\DynamoCore.sln /p:Configuration=Release --runtime=win-x64 + - name: Build Dynamo with MSBuild for Windows + run: | + Write-Output "***Continue with the build, Good luck developer!***" + msbuild ${{ github.workspace }}\Dynamo\src\DynamoCore.sln /p:Configuration=Release + - name: Look for DynamoCLI.exe + run: | + Write-Output "***Locating DynamoCLI.exe!***" + if (Test-Path -Path "${{ github.workspace }}\Dynamo\bin\AnyCPU\Release\DynamoCLI.exe") { + Write-Output "DynamoCLI.exe exists!" + } else { + Write-Error "DynamoCLI.exe was not found!" + } + - name: Install dependencies for linux runtime + run: dotnet restore ${{ github.workspace }}\Dynamo\src\DynamoCore.sln -p:Platform=NET60_Linux --runtime=linux-x64 + - name: Build Dynamo with MSBuild for Linux + run: | + Write-Output "***Continue with the build, Good luck developer!***" + msbuild ${{ github.workspace }}\Dynamo\src\DynamoCore.sln /p:Configuration=Release /p:Platform=NET60_Linux + - name: Look for DynamoCLI + run: | + Write-Output "***Locating DynamoCLI for Linux!***" + if (Test-Path -Path "${{ github.workspace }}\Dynamo\bin\NET60_Linux\Release\DynamoCLI") { + Write-Output "DynamoCLI exists!" + } else { + Write-Error "DynamoCLI was not found!" + }