From aca99a4ec564a9c3f0ee59bc39fd2ee42c43d7ae Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 09:57:39 +0530 Subject: [PATCH 01/42] Adding .DS_Store to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 43c670ad..5681e5da 100644 --- a/.gitignore +++ b/.gitignore @@ -191,3 +191,5 @@ build.bat git_push.sh mono_nunit_test.sh .vs/ + +.DS_Store From 7027088e4b40fa1e1d4dbb30d34cd6ebda86ddb9 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 13:58:42 +0530 Subject: [PATCH 02/42] github workflow run --- .github/workflows/workflow.yml | 68 ++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 00000000..f731085c --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,68 @@ +name: DOTNET BUILDS +on: + push: + pull_request: + workflow_dispatch: +env: + CLIENT_FOLDER: 'cybersource-rest-client-dotnet' + SAMPLE_FOLDER: 'cybersource-rest-samples-csharp' +jobs: + workflow-job: + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + operating-system: [windows-latest] + runs-on: ${{matrix.operating-system}} + steps: + - name: Creating separate folders for checkout repos + run: | + rm -rf $CLIENT_FOLDER + rm -rf $SAMPLE_FOLDER + mkdir $CLIENT_FOLDER $SAMPLE_FOLDER + - name: Checkout cybersource-rest-client-dotnet repo + uses: actions/checkout@v4 + with: + path: ${{env.CLIENT_FOLDER}} + - name: Checkout cybersource-rest-samples-csharp repo + uses: actions/checkout@v4 + with: + repository: 'CyberSource/cybersource-rest-samples-csharp' + ref: 'testing-branch' # this is used for checking out a particular branch in repo + path: ${{env.SAMPLE_FOLDER}} + - name: Building the projects and running the Test Cases + run: | + cd $CLIENT_FOLDER + (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj + nuget install packages.config -OutputDirectory packages + nuget install ./test/packages.config -OutputDirectory packages + Write-Output "Passed!!!" + shell: pwsh + # - name: Setup Python v3.12 for report generation only + # uses: actions/setup-python@v5 + # with: + # python-version: 3.12 + # - name: Installing required python libraries and running the python programs to generate pdf report + # run : | + # echo $VIRTUAL_ENV + # echo "Before Running Report Generation" + # echo "PWD" + # pwd + # cd $SAMPLE_FOLDER + # python -m pip install --upgrade pip + # pip install json2html + # pip install xhtml2pdf + # pip install bs4 + # cd Validation + # python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/python_actual_results.json + # python response_code_validator.py -e ExpectedResults/python_expected_results.json -a ../../$SAMPLE_FOLDER/python_actual_results.json -o python_validation_results.json + # python json_to_prettified_html.py -i python_validation_results.json -o python_validation_results.html + # cp python_validation_results.pdf ../ #copying the file to flaatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 + # - name: Upload Test Reports + # uses: actions/upload-artifact@v4 + # with: + # name: log-files-${{matrix.operating-system}}-python-ver-${{matrix.pyth-version}} + # path: | + # ${{env.SAMPLE_FOLDER}}/python_validation_results.pdf From c6f60fa4d15fa28c25a16f0b9370ca4715ead667 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:03:54 +0530 Subject: [PATCH 03/42] Update workflow.yml --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f731085c..78d99409 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -35,6 +35,7 @@ jobs: - name: Building the projects and running the Test Cases run: | cd $CLIENT_FOLDER + Get-Location (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj nuget install packages.config -OutputDirectory packages nuget install ./test/packages.config -OutputDirectory packages From 131bc5d0ae244bc39a28f716a7dc8bb9566925fe Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:05:55 +0530 Subject: [PATCH 04/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 78d99409..031b85c1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -34,6 +34,8 @@ jobs: path: ${{env.SAMPLE_FOLDER}} - name: Building the projects and running the Test Cases run: | + Get-Location + ls cd $CLIENT_FOLDER Get-Location (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj From bc197df7bd03e5d707647eb0b85688d05c6a19f4 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:07:12 +0530 Subject: [PATCH 05/42] Update workflow.yml --- .github/workflows/workflow.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 031b85c1..bf558388 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -35,13 +35,13 @@ jobs: - name: Building the projects and running the Test Cases run: | Get-Location - ls - cd $CLIENT_FOLDER - Get-Location - (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj - nuget install packages.config -OutputDirectory packages - nuget install ./test/packages.config -OutputDirectory packages - Write-Output "Passed!!!" + # ls + # cd $CLIENT_FOLDER + # Get-Location + # (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj + # nuget install packages.config -OutputDirectory packages + # nuget install ./test/packages.config -OutputDirectory packages + # Write-Output "Passed!!!" shell: pwsh # - name: Setup Python v3.12 for report generation only # uses: actions/setup-python@v5 From 8a490a4db1b77defebf0cdefd6f3ed751257d457 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:08:28 +0530 Subject: [PATCH 06/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bf558388..b751bf4b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -35,9 +35,9 @@ jobs: - name: Building the projects and running the Test Cases run: | Get-Location + Get-ChildItem # ls # cd $CLIENT_FOLDER - # Get-Location # (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj # nuget install packages.config -OutputDirectory packages # nuget install ./test/packages.config -OutputDirectory packages From 57f56efc1eb0053c7e4d6342cf1a1bc5458dec2a Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:13:34 +0530 Subject: [PATCH 07/42] Update workflow.yml --- .github/workflows/workflow.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b751bf4b..3481f93c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -36,12 +36,11 @@ jobs: run: | Get-Location Get-ChildItem - # ls - # cd $CLIENT_FOLDER - # (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj - # nuget install packages.config -OutputDirectory packages - # nuget install ./test/packages.config -OutputDirectory packages - # Write-Output "Passed!!!" + cd $Env:CLIENT_FOLDER + (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj + nuget install packages.config -OutputDirectory packages + nuget install ./test/packages.config -OutputDirectory packages + Write-Output "Passed!!!" shell: pwsh # - name: Setup Python v3.12 for report generation only # uses: actions/setup-python@v5 From 455a0b095f3492dd62cef8256fbacb179663f91e Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:15:25 +0530 Subject: [PATCH 08/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3481f93c..6f94bfa4 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -37,7 +37,7 @@ jobs: Get-Location Get-ChildItem cd $Env:CLIENT_FOLDER - (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { \$_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj + (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { $_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj nuget install packages.config -OutputDirectory packages nuget install ./test/packages.config -OutputDirectory packages Write-Output "Passed!!!" From 13ba95e379491b432af8e434f3bba502a4fe4ef5 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:17:05 +0530 Subject: [PATCH 09/42] building with MS build --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6f94bfa4..860b8d2c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -41,6 +41,8 @@ jobs: nuget install packages.config -OutputDirectory packages nuget install ./test/packages.config -OutputDirectory packages Write-Output "Passed!!!" + $env:msBuildExe -version + $env:msBuildExe -property:Configuration=Release "cybersource-rest-client-dotnet.sln" shell: pwsh # - name: Setup Python v3.12 for report generation only # uses: actions/setup-python@v5 From 28c80fe2393fe3dcc259b05afe2e4489c2310d98 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:19:47 +0530 Subject: [PATCH 10/42] Update workflow.yml --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 860b8d2c..6b15ab3a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -41,8 +41,8 @@ jobs: nuget install packages.config -OutputDirectory packages nuget install ./test/packages.config -OutputDirectory packages Write-Output "Passed!!!" - $env:msBuildExe -version - $env:msBuildExe -property:Configuration=Release "cybersource-rest-client-dotnet.sln" + msbuild -version + msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" shell: pwsh # - name: Setup Python v3.12 for report generation only # uses: actions/setup-python@v5 From e3c9a379caac1ab9a027db6935bc1fc2418b313d Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:27:26 +0530 Subject: [PATCH 11/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6b15ab3a..07520d65 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -32,6 +32,8 @@ jobs: repository: 'CyberSource/cybersource-rest-samples-csharp' ref: 'testing-branch' # this is used for checking out a particular branch in repo path: ${{env.SAMPLE_FOLDER}} + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 - name: Building the projects and running the Test Cases run: | Get-Location From 9f9cec964302a55c80242864bb9651dd8a934c30 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 14:37:37 +0530 Subject: [PATCH 12/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 07520d65..91ac5c25 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [windows-latest] + operating-system: [windows-2019] runs-on: ${{matrix.operating-system}} steps: - name: Creating separate folders for checkout repos From e39edd9855a7e7851f4db09b7f2bfad75512c8ab Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 15:08:08 +0530 Subject: [PATCH 13/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 91ac5c25..2b1f1377 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -39,12 +39,12 @@ jobs: Get-Location Get-ChildItem cd $Env:CLIENT_FOLDER - (Get-Content ./cybersource-rest-client-dotnet.csproj) | ForEach-Object { $_ -replace "()(.)+(AuthenticationSdk.dll)", "..\\cybersource-rest-auth-dotnet\\AuthenticationSdk\\AuthenticationSdk\\bin\\Release\\AuthenticationSdk.dll" } | Set-Content ./cybersource-rest-client-dotnet.csproj nuget install packages.config -OutputDirectory packages nuget install ./test/packages.config -OutputDirectory packages Write-Output "Passed!!!" msbuild -version msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" + Write-Output "Build Successful" shell: pwsh # - name: Setup Python v3.12 for report generation only # uses: actions/setup-python@v5 From 211f749c92cd6e4db54ce7f0f618cf79638505ae Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 15:45:07 +0530 Subject: [PATCH 14/42] Update workflow.yml --- .github/workflows/workflow.yml | 60 +++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2b1f1377..b81ab28c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -45,30 +45,38 @@ jobs: msbuild -version msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" Write-Output "Build Successful" + Set-Location .. + cd $Env:SAMPLE_FOLDER + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { \$_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj + #Replaced the Dependency path to locally build cybersource-rest-client-dotnet.dll file + nuget install packages.config -OutputDirectory packages + msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" + cd bin/Release/net461 + ./SampleCode.exe -RunAll > output.log + Copy-Item ".\output.log" -Destination "..\..\..\" shell: pwsh - # - name: Setup Python v3.12 for report generation only - # uses: actions/setup-python@v5 - # with: - # python-version: 3.12 - # - name: Installing required python libraries and running the python programs to generate pdf report - # run : | - # echo $VIRTUAL_ENV - # echo "Before Running Report Generation" - # echo "PWD" - # pwd - # cd $SAMPLE_FOLDER - # python -m pip install --upgrade pip - # pip install json2html - # pip install xhtml2pdf - # pip install bs4 - # cd Validation - # python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/python_actual_results.json - # python response_code_validator.py -e ExpectedResults/python_expected_results.json -a ../../$SAMPLE_FOLDER/python_actual_results.json -o python_validation_results.json - # python json_to_prettified_html.py -i python_validation_results.json -o python_validation_results.html - # cp python_validation_results.pdf ../ #copying the file to flaatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 - # - name: Upload Test Reports - # uses: actions/upload-artifact@v4 - # with: - # name: log-files-${{matrix.operating-system}}-python-ver-${{matrix.pyth-version}} - # path: | - # ${{env.SAMPLE_FOLDER}}/python_validation_results.pdf + - name: Setup Python v3.12 for report generation only + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Installing required python libraries and running the python programs to generate pdf report + run : | + echo $VIRTUAL_ENV + echo "Before Running Report Generation" + echo "PWD" + pwd + cd $SAMPLE_FOLDER + python -m pip install --upgrade pip + pip install json2html + pip install xhtml2pdf + pip install bs4 + cd Validation + python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/csharp_actual_results.json + python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results.json + python json_to_prettified_html.py -i csharp_validation_results.json -o csharp_validation_results.html + cp csharp_validation_results.pdf ../ #copying the file to flaatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 + - name: Upload Test Reports + uses: actions/upload-artifact@v4 + with: + path: | + ${{env.SAMPLE_FOLDER}}/csharp_validation_results.pdf From 05a476bd0eeef33b34c1fa2c9e7ad5fc3fc5436d Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 15:54:27 +0530 Subject: [PATCH 15/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b81ab28c..5af88d2f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -47,7 +47,7 @@ jobs: Write-Output "Build Successful" Set-Location .. cd $Env:SAMPLE_FOLDER - (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { \$_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj #Replaced the Dependency path to locally build cybersource-rest-client-dotnet.dll file nuget install packages.config -OutputDirectory packages msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" From 7b908d968d9ca750750f1aed7363bbfd5b43be41 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 16:07:48 +0530 Subject: [PATCH 16/42] Update workflow.yml --- .github/workflows/workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5af88d2f..2603e2b9 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -51,9 +51,14 @@ jobs: #Replaced the Dependency path to locally build cybersource-rest-client-dotnet.dll file nuget install packages.config -OutputDirectory packages msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" + Write-Output "After Build" cd bin/Release/net461 + Write-Output "Changed Folder" + Write-Output "Before Running SampleCode.exe" ./SampleCode.exe -RunAll > output.log + Write-Output "After Running SampleCode.exe" Copy-Item ".\output.log" -Destination "..\..\..\" + Write-Output "Copied Output.log" shell: pwsh - name: Setup Python v3.12 for report generation only uses: actions/setup-python@v5 From d831a21040053eaa9bcf018c9ebe3e63c799abe8 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 24 Jun 2024 16:31:08 +0530 Subject: [PATCH 17/42] Update workflow.yml --- .github/workflows/workflow.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2603e2b9..621945eb 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -55,11 +55,11 @@ jobs: cd bin/Release/net461 Write-Output "Changed Folder" Write-Output "Before Running SampleCode.exe" - ./SampleCode.exe -RunAll > output.log + ./SampleCode.exe -RunAll > testing_dotnet.log Write-Output "After Running SampleCode.exe" - Copy-Item ".\output.log" -Destination "..\..\..\" + Copy-Item ".\testing_dotnet.log" -Destination "..\..\..\" Write-Output "Copied Output.log" - shell: pwsh + shell: pwsh - name: Setup Python v3.12 for report generation only uses: actions/setup-python@v5 with: @@ -75,6 +75,7 @@ jobs: pip install json2html pip install xhtml2pdf pip install bs4 + mv testing_dotnet.log output.log cd Validation python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/csharp_actual_results.json python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results.json @@ -85,3 +86,4 @@ jobs: with: path: | ${{env.SAMPLE_FOLDER}}/csharp_validation_results.pdf + ${{env.SAMPLE_FOLDER}}/output.log From 4ce8d93f37e4faa97fc475b57a1dce567e82fd53 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Tue, 25 Jun 2024 16:16:56 +0530 Subject: [PATCH 18/42] Update workflow.yml --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 621945eb..236e0da2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -87,3 +87,4 @@ jobs: path: | ${{env.SAMPLE_FOLDER}}/csharp_validation_results.pdf ${{env.SAMPLE_FOLDER}}/output.log +#adding comment From d39e0851ea037278a35b1ce34e7e796dc07bd5a9 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 26 Jun 2024 10:55:40 +0530 Subject: [PATCH 19/42] Update workflow.yml --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 236e0da2..0231f12d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [windows-2019] + operating-system: [windows-2022] runs-on: ${{matrix.operating-system}} steps: - name: Creating separate folders for checkout repos @@ -48,7 +48,7 @@ jobs: Set-Location .. cd $Env:SAMPLE_FOLDER (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj - #Replaced the Dependency path to locally build cybersource-rest-client-dotnet.dll file + #Replaced the Dependency path to locally build cybersource-rest-client-dotnet.dll file nuget install packages.config -OutputDirectory packages msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" Write-Output "After Build" From e6ffa78b19c56c3db41f6727cf94e68f95f1d369 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 26 Jun 2024 11:18:16 +0530 Subject: [PATCH 20/42] Update workflow.yml --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0231f12d..b9af337b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -87,4 +87,5 @@ jobs: path: | ${{env.SAMPLE_FOLDER}}/csharp_validation_results.pdf ${{env.SAMPLE_FOLDER}}/output.log + ${{env.CLIENT_FOLDER}} #adding comment From f5242775d7fac14a9068af59803e21be97b50dd2 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 26 Jun 2024 11:18:52 +0530 Subject: [PATCH 21/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b9af337b..13226bf7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [windows-2022] + operating-system: [windows-2019] runs-on: ${{matrix.operating-system}} steps: - name: Creating separate folders for checkout repos From 9d785cefecfc5e2d0ec1c3d6663fb62e4ed31457 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 26 Jun 2024 13:52:47 +0530 Subject: [PATCH 22/42] Checking for different combinations of environments --- .github/workflows/workflow.yml | 132 ++++++++++++++++++--------------- 1 file changed, 71 insertions(+), 61 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 13226bf7..9a5151cc 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -7,85 +7,95 @@ env: CLIENT_FOLDER: 'cybersource-rest-client-dotnet' SAMPLE_FOLDER: 'cybersource-rest-samples-csharp' jobs: - workflow-job: + build-the-dotnet-client: defaults: run: shell: bash - strategy: - fail-fast: false - matrix: - operating-system: [windows-2019] - runs-on: ${{matrix.operating-system}} + runs-on: windows-2019 steps: - - name: Creating separate folders for checkout repos - run: | - rm -rf $CLIENT_FOLDER - rm -rf $SAMPLE_FOLDER - mkdir $CLIENT_FOLDER $SAMPLE_FOLDER - name: Checkout cybersource-rest-client-dotnet repo uses: actions/checkout@v4 with: path: ${{env.CLIENT_FOLDER}} - - name: Checkout cybersource-rest-samples-csharp repo - uses: actions/checkout@v4 - with: - repository: 'CyberSource/cybersource-rest-samples-csharp' - ref: 'testing-branch' # this is used for checking out a particular branch in repo - path: ${{env.SAMPLE_FOLDER}} - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - name: Building the projects and running the Test Cases run: | - Get-Location - Get-ChildItem cd $Env:CLIENT_FOLDER nuget install packages.config -OutputDirectory packages nuget install ./test/packages.config -OutputDirectory packages - Write-Output "Passed!!!" - msbuild -version msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" Write-Output "Build Successful" - Set-Location .. - cd $Env:SAMPLE_FOLDER - (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj - #Replaced the Dependency path to locally build cybersource-rest-client-dotnet.dll file - nuget install packages.config -OutputDirectory packages - msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" - Write-Output "After Build" - cd bin/Release/net461 - Write-Output "Changed Folder" - Write-Output "Before Running SampleCode.exe" - ./SampleCode.exe -RunAll > testing_dotnet.log - Write-Output "After Running SampleCode.exe" - Copy-Item ".\testing_dotnet.log" -Destination "..\..\..\" - Write-Output "Copied Output.log" shell: pwsh - - name: Setup Python v3.12 for report generation only - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - name: Installing required python libraries and running the python programs to generate pdf report - run : | - echo $VIRTUAL_ENV - echo "Before Running Report Generation" - echo "PWD" - pwd - cd $SAMPLE_FOLDER - python -m pip install --upgrade pip - pip install json2html - pip install xhtml2pdf - pip install bs4 - mv testing_dotnet.log output.log - cd Validation - python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/csharp_actual_results.json - python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results.json - python json_to_prettified_html.py -i csharp_validation_results.json -o csharp_validation_results.html - cp csharp_validation_results.pdf ../ #copying the file to flaatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 - - name: Upload Test Reports + - name: Upload the DOTNET Rest Client Build uses: actions/upload-artifact@v4 with: + name: dotnet-build path: | - ${{env.SAMPLE_FOLDER}}/csharp_validation_results.pdf - ${{env.SAMPLE_FOLDER}}/output.log - ${{env.CLIENT_FOLDER}} -#adding comment + ${{env.CLIENT_FOLDER}}/bin + build-the-samples-and-run-test: + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + operating-system: [windows-latest,windows-2019] + net-framework-version: [4.6.2,4.7,4.7.1,4.7.2,4.8,4.8.1] + include: + - operating-system: windows-2019 + net-framework-version: 4.6.1 + exclude: + - operating-system: windows-2019 + net-framework-version: 4.8.1 + needs: build-the-dotnet-client # to make sure these jobs only start once the already present jobs are done running + runs-on: ${{matrix.operating-system}} + steps: + - name: Download the Built Rest Client for Dotnet + uses: actions/download-artifact@v4 + with: + name: dotnet-build + path: ${{env.CLIENT_FOLDER}} + - name: Checkout cybersource-rest-samples-csharp repo + uses: actions/checkout@v4 + with: + repository: 'CyberSource/cybersource-rest-samples-csharp' + ref: 'testing-branch' + path: ${{env.SAMPLE_FOLDER}} + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + - name: Building the samples and Running the Tests + run: | + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj + #Replaced the Dependency path to already built cybersource-rest-client-dotnet project which was downloaded to the runner + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "v4.6.1", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj + nuget install packages.config -OutputDirectory packages + msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" + cd bin/Release/net461 + Write-Output "Running Samples now" + ./SampleCode.exe -RunAll > testing_dotnet.log + Copy-Item ".\testing_dotnet.log" -Destination "..\..\..\" + shell: pwsh + - name: Setup Python v3.12 for Report Generation + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Installing required python libraries and running the python programs to generate pdf report + run : | + cd $SAMPLE_FOLDER + python -m pip install --upgrade pip + pip install json2html + pip install xhtml2pdf + pip install bs4 + mv testing_dotnet.log output.log + cd Validation + python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/csharp_actual_results.json + python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results.json + python json_to_prettified_html.py -i csharp_validation_results.json -o csharp_validation_results.html + cp csharp_validation_results.pdf ../ #copying the file to flatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 + - name: Upload the Test Reports + uses: actions/upload-artifact@v4 + with: + name: result-files-${{matrix.operating-system}}-python-ver-${{matrix.net-framework-version}} + path: | + ${{env.SAMPLE_FOLDER}}/csharp_validation_results.pdf \ No newline at end of file From 801f1c198938898adc3f367cb53a82e3f1e1acab Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 26 Jun 2024 14:02:27 +0530 Subject: [PATCH 23/42] Update workflow.yml --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9a5151cc..369dd8cb 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -66,6 +66,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Building the samples and Running the Tests run: | + cd $Env:SAMPLE_FOLDER (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj #Replaced the Dependency path to already built cybersource-rest-client-dotnet project which was downloaded to the runner (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "v4.6.1", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj From d1a4cd942056a5e17b1b0759cb44cddacbb14b53 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 26 Jun 2024 14:11:04 +0530 Subject: [PATCH 24/42] Update workflow.yml --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 369dd8cb..59b5907d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -32,7 +32,7 @@ jobs: with: name: dotnet-build path: | - ${{env.CLIENT_FOLDER}}/bin + ${{env.CLIENT_FOLDER}} build-the-samples-and-run-test: defaults: run: @@ -55,7 +55,6 @@ jobs: uses: actions/download-artifact@v4 with: name: dotnet-build - path: ${{env.CLIENT_FOLDER}} - name: Checkout cybersource-rest-samples-csharp repo uses: actions/checkout@v4 with: @@ -66,6 +65,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Building the samples and Running the Tests run: | + Get-ChildItem cd $Env:SAMPLE_FOLDER (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj #Replaced the Dependency path to already built cybersource-rest-client-dotnet project which was downloaded to the runner From 52b4f85fbcbf22c624fe3ff1d402f46f5cbebed3 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 26 Jun 2024 14:17:02 +0530 Subject: [PATCH 25/42] Update workflow.yml --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 59b5907d..84d4101a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -55,6 +55,7 @@ jobs: uses: actions/download-artifact@v4 with: name: dotnet-build + path: ${{env.CLIENT_FOLDER}} - name: Checkout cybersource-rest-samples-csharp repo uses: actions/checkout@v4 with: From 0cb972f9d06b94889b52a051b3a188693fd4bdce Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 26 Jun 2024 14:27:16 +0530 Subject: [PATCH 26/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 84d4101a..6984d9c7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -98,6 +98,6 @@ jobs: - name: Upload the Test Reports uses: actions/upload-artifact@v4 with: - name: result-files-${{matrix.operating-system}}-python-ver-${{matrix.net-framework-version}} + name: result-files-${{matrix.operating-system}}-net-framework-ver-${{matrix.net-framework-version}} path: | ${{env.SAMPLE_FOLDER}}/csharp_validation_results.pdf \ No newline at end of file From ede3dee240a4e5ad20cde15c216f2cd353fac794 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Fri, 28 Jun 2024 11:58:14 +0530 Subject: [PATCH 27/42] Update workflow.yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6984d9c7..7ff03582 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -70,7 +70,7 @@ jobs: cd $Env:SAMPLE_FOLDER (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj #Replaced the Dependency path to already built cybersource-rest-client-dotnet project which was downloaded to the runner - (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "v4.6.1", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+()", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj nuget install packages.config -OutputDirectory packages msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" cd bin/Release/net461 From 3f2c18da6a3aaa8f3221b7da3c6857d7128548f1 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 1 Jul 2024 12:10:37 +0530 Subject: [PATCH 28/42] Update workflow.yml --- .github/workflows/workflow.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7ff03582..dc21228f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -19,21 +19,22 @@ jobs: path: ${{env.CLIENT_FOLDER}} - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - - name: Building the projects and running the Test Cases + - name: Building the Dotnet Client run: | cd $Env:CLIENT_FOLDER nuget install packages.config -OutputDirectory packages nuget install ./test/packages.config -OutputDirectory packages + msbuild -version msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" Write-Output "Build Successful" shell: pwsh - - name: Upload the DOTNET Rest Client Build + - name: Upload the Dotnet Rest Client Build uses: actions/upload-artifact@v4 with: name: dotnet-build path: | ${{env.CLIENT_FOLDER}} - build-the-samples-and-run-test: + build-the-samples-and-run-tests: defaults: run: shell: bash @@ -51,7 +52,7 @@ jobs: needs: build-the-dotnet-client # to make sure these jobs only start once the already present jobs are done running runs-on: ${{matrix.operating-system}} steps: - - name: Download the Built Rest Client for Dotnet + - name: Download the Built Rest Client for Dotnet from previous Job uses: actions/download-artifact@v4 with: name: dotnet-build @@ -66,10 +67,10 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Building the samples and Running the Tests run: | - Get-ChildItem + msbuild -version cd $Env:SAMPLE_FOLDER (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj - #Replaced the Dependency path to already built cybersource-rest-client-dotnet project which was downloaded to the runner + #Replaced the Dependency path to already built cybersource-rest-client-dotnet dll file which was downloaded to the runner (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+()", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj nuget install packages.config -OutputDirectory packages msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" @@ -92,12 +93,12 @@ jobs: mv testing_dotnet.log output.log cd Validation python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/csharp_actual_results.json - python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results.json - python json_to_prettified_html.py -i csharp_validation_results.json -o csharp_validation_results.html - cp csharp_validation_results.pdf ../ #copying the file to flatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 + python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results_dotnet.json + python json_to_prettified_html.py -i csharp_validation_results_dotnet.json -o csharp_validation_results_dotnet.html + cp csharp_validation_results_dotnet.pdf ../ #copying the file to flatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 - name: Upload the Test Reports uses: actions/upload-artifact@v4 with: name: result-files-${{matrix.operating-system}}-net-framework-ver-${{matrix.net-framework-version}} path: | - ${{env.SAMPLE_FOLDER}}/csharp_validation_results.pdf \ No newline at end of file + ${{env.SAMPLE_FOLDER}}/csharp_validation_results_dotnet.pdf \ No newline at end of file From 1d4d1f916040a93fb0b61792c3be93040a3f9d0b Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 1 Jul 2024 16:35:48 +0530 Subject: [PATCH 29/42] Making changes to the strategy matrix [no ci] --- .github/workflows/workflow.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index dc21228f..611fd8b6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -31,7 +31,7 @@ jobs: - name: Upload the Dotnet Rest Client Build uses: actions/upload-artifact@v4 with: - name: dotnet-build + name: dotnet-build # discuss with Gaurav and gabriel about naming of the dll artifacts path: | ${{env.CLIENT_FOLDER}} build-the-samples-and-run-tests: @@ -42,13 +42,12 @@ jobs: fail-fast: false matrix: operating-system: [windows-latest,windows-2019] - net-framework-version: [4.6.2,4.7,4.7.1,4.7.2,4.8,4.8.1] - include: - - operating-system: windows-2019 - net-framework-version: 4.6.1 + net-framework-version: [4.6.1,4.6.2,4.7,4.7.1,4.7.2,4.8,4.8.1] exclude: - operating-system: windows-2019 net-framework-version: 4.8.1 + - operating-system: windows-latest + net-framework-version: 4.6.1 needs: build-the-dotnet-client # to make sure these jobs only start once the already present jobs are done running runs-on: ${{matrix.operating-system}} steps: From 7f79193f86b8e98288493e5a2c2cfd85b43f1f43 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 1 Jul 2024 16:44:37 +0530 Subject: [PATCH 30/42] Adding Status Badge [no ci] --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8ac7633a..ce5e2d4d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # .NET Client SDK for the CyberSource REST API +[![DOTNET BUILDS](https://github.com/CyberSource/cybersource-rest-client-dotnet/actions/workflows/workflow.yml/badge.svg)](https://github.com/CyberSource/cybersource-rest-client-dotnet/actions/workflows/workflow.yml) + ## Description The CyberSource .NET client provides convenient access to the [CyberSource REST API](https://developer.cybersource.com/api/reference/api-reference.html) from your .NET application. From 3d9a3dd3fdabe9491c2a77d8083ead937011333c Mon Sep 17 00:00:00 2001 From: aasgoel Date: Wed, 3 Jul 2024 15:45:30 +0530 Subject: [PATCH 31/42] checking with report-generation action --- .github/actions/generate-report/action.yml | 58 ++++++++++++++++++++++ .github/workflows/workflow.yml | 49 +++++++++++------- 2 files changed, 88 insertions(+), 19 deletions(-) create mode 100644 .github/actions/generate-report/action.yml diff --git a/.github/actions/generate-report/action.yml b/.github/actions/generate-report/action.yml new file mode 100644 index 00000000..b3787523 --- /dev/null +++ b/.github/actions/generate-report/action.yml @@ -0,0 +1,58 @@ +name: 'Generate the Report' +description: 'Generates the report using the log-file-name file present just inside the sample folder path provided , given Validation Folder is there inside the sample folder as well' +inputs: + lang: + description: 'The language or framework in which SDK is written needs to be given as an input' + required: true + sample-folder-name: + description: 'The name of the sample folder' + required: true + log-file-name: + description: 'The name of the generated log file' + required: true +outputs: + result-pdf-name: + description: 'the name of the final generated pdf report' + value: ${{steps.generate.outputs.pdfname}} +runs: + using: 'composite' + steps: + - name: Setup Python v3.12 for report generation only + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Installing required python libraries and running the python programs to generate pdf report + id: generate + run : | + export EXPECTED_RES_LANG=${{inputs.lang}} + if [[ "${{inputs.lang}}" == "dotnet" ]] || [[ "${{inputs.lang}}" == "dotnetstandard" ]]; then + export EXPECTED_RES_LANG=csharp + fi + echo $EXPECTED_RES_LANG + python --version + echo "Before Running Report Generation" + cd ${{inputs.sample-folder-name}} + python -m pip install --upgrade pip + python -m venv newve + if [[ "$(uname -s)" == "Linux" ]]; then + echo "In LINUX" + source newve/bin/activate + elif [[ "$(uname -s)" == "Darwin" ]]; then + echo "In MAC" + source newve/bin/activate + else + echo "In Windows" + source newve/Scripts/activate + fi + echo $VIRTUAL_ENV + pip install json2html + pip install xhtml2pdf + pip install bs4 + cd Validation + python sample_code_log_processor.py -l ../../${{inputs.sample-folder-name}}/${{inputs.log-file-name}} -o ../../${{inputs.sample-folder-name}}/${{inputs.lang}}_actual_results.json + python response_code_validator.py -e ExpectedResults/${EXPECTED_RES_LANG}_expected_results.json -a ../../${{inputs.sample-folder-name}}/${{inputs.lang}}_actual_results.json -o ${{inputs.lang}}_validation_results.json + python json_to_prettified_html.py -i ${{inputs.lang}}_validation_results.json -o ${{inputs.lang}}_validation_results.html + cp ${{inputs.lang}}_validation_results.pdf ../ #copying the file to flaatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 + echo "pdfname=${{inputs.lang}}_validation_results.pdf" >> $GITHUB_OUTPUT + shell: bash + diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 611fd8b6..6e5ca285 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -77,27 +77,38 @@ jobs: Write-Output "Running Samples now" ./SampleCode.exe -RunAll > testing_dotnet.log Copy-Item ".\testing_dotnet.log" -Destination "..\..\..\" + Set-Location ..\..\.. + Move-Item -Path .\testing_dotnet.log -Destination .\output.log shell: pwsh - - name: Setup Python v3.12 for Report Generation - uses: actions/setup-python@v5 + - name: Using Report Generation Action + id: report-generation + uses: ./cybersource-rest-client-dotnet/.github/actions/generate-report with: - python-version: 3.12 - - name: Installing required python libraries and running the python programs to generate pdf report - run : | - cd $SAMPLE_FOLDER - python -m pip install --upgrade pip - pip install json2html - pip install xhtml2pdf - pip install bs4 - mv testing_dotnet.log output.log - cd Validation - python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/csharp_actual_results.json - python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results_dotnet.json - python json_to_prettified_html.py -i csharp_validation_results_dotnet.json -o csharp_validation_results_dotnet.html - cp csharp_validation_results_dotnet.pdf ../ #copying the file to flatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 - - name: Upload the Test Reports + lang: dotnet + sample-folder-name: ${{env.SAMPLE_FOLDER}} + log-file-name: output.log + - name: Upload Test Reports uses: actions/upload-artifact@v4 with: - name: result-files-${{matrix.operating-system}}-net-framework-ver-${{matrix.net-framework-version}} + name: sample-run-report-${{matrix.operating-system}}-dotnet-framework-ver-${{matrix.net-framework-version}} path: | - ${{env.SAMPLE_FOLDER}}/csharp_validation_results_dotnet.pdf \ No newline at end of file + ${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}} + + +# - name: Setup Python v3.12 for Report Generation +# uses: actions/setup-python@v5 +# with: +# python-version: 3.12 +# - name: Installing required python libraries and running the python programs to generate pdf report +# run : | +# cd $SAMPLE_FOLDER +# python -m pip install --upgrade pip +# pip install json2html +# pip install xhtml2pdf +# pip install bs4 + +# cd Validation +# python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/csharp_actual_results.json +# python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results_dotnet.json +# python json_to_prettified_html.py -i csharp_validation_results_dotnet.json -o csharp_validation_results_dotnet.html +# cp csharp_validation_results_dotnet.pdf ../ #copying the file to flatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 \ No newline at end of file From e085f1c57316821332b788d857571e14b9d59780 Mon Sep 17 00:00:00 2001 From: aasgoel Date: Mon, 8 Jul 2024 15:14:44 +0530 Subject: [PATCH 32/42] [no ci] --- .github/workflows/workflow.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6e5ca285..93ad905a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -93,22 +93,3 @@ jobs: name: sample-run-report-${{matrix.operating-system}}-dotnet-framework-ver-${{matrix.net-framework-version}} path: | ${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}} - - -# - name: Setup Python v3.12 for Report Generation -# uses: actions/setup-python@v5 -# with: -# python-version: 3.12 -# - name: Installing required python libraries and running the python programs to generate pdf report -# run : | -# cd $SAMPLE_FOLDER -# python -m pip install --upgrade pip -# pip install json2html -# pip install xhtml2pdf -# pip install bs4 - -# cd Validation -# python sample_code_log_processor.py -l ../../$SAMPLE_FOLDER/output.log -o ../../$SAMPLE_FOLDER/csharp_actual_results.json -# python response_code_validator.py -e ExpectedResults/csharp_expected_results.json -a ../../$SAMPLE_FOLDER/csharp_actual_results.json -o csharp_validation_results_dotnet.json -# python json_to_prettified_html.py -i csharp_validation_results_dotnet.json -o csharp_validation_results_dotnet.html -# cp csharp_validation_results_dotnet.pdf ../ #copying the file to flatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024 \ No newline at end of file From c0cb255fcba47fb7b47bd651944e4b790b8a07af Mon Sep 17 00:00:00 2001 From: aasgoel Date: Tue, 9 Jul 2024 11:23:16 +0530 Subject: [PATCH 33/42] [no ci] --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 93ad905a..5bfdfda0 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -31,7 +31,7 @@ jobs: - name: Upload the Dotnet Rest Client Build uses: actions/upload-artifact@v4 with: - name: dotnet-build # discuss with Gaurav and gabriel about naming of the dll artifacts + name: dotnet-build # discuss with Gaurav and Gabriel about naming of the dll artifacts path: | ${{env.CLIENT_FOLDER}} build-the-samples-and-run-tests: From a97f7f946cf85f4b96ad24a944a136ed7d423eba Mon Sep 17 00:00:00 2001 From: aasgoel Date: Tue, 16 Jul 2024 11:49:36 +0530 Subject: [PATCH 34/42] updated samples ref to master --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5bfdfda0..701d5bd5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -60,7 +60,7 @@ jobs: uses: actions/checkout@v4 with: repository: 'CyberSource/cybersource-rest-samples-csharp' - ref: 'testing-branch' + ref: 'master' path: ${{env.SAMPLE_FOLDER}} - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 From 66e5ae0c89beb957f5a5b17c8058e439299569e7 Mon Sep 17 00:00:00 2001 From: gaubansa Date: Fri, 16 Aug 2024 23:01:11 +0530 Subject: [PATCH 35/42] disable the workflow --- .github/workflows/workflow.yml | 190 ++++++++++++++++----------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 701d5bd5..32a119a9 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,95 +1,95 @@ -name: DOTNET BUILDS -on: - push: - pull_request: - workflow_dispatch: -env: - CLIENT_FOLDER: 'cybersource-rest-client-dotnet' - SAMPLE_FOLDER: 'cybersource-rest-samples-csharp' -jobs: - build-the-dotnet-client: - defaults: - run: - shell: bash - runs-on: windows-2019 - steps: - - name: Checkout cybersource-rest-client-dotnet repo - uses: actions/checkout@v4 - with: - path: ${{env.CLIENT_FOLDER}} - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - name: Building the Dotnet Client - run: | - cd $Env:CLIENT_FOLDER - nuget install packages.config -OutputDirectory packages - nuget install ./test/packages.config -OutputDirectory packages - msbuild -version - msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" - Write-Output "Build Successful" - shell: pwsh - - name: Upload the Dotnet Rest Client Build - uses: actions/upload-artifact@v4 - with: - name: dotnet-build # discuss with Gaurav and Gabriel about naming of the dll artifacts - path: | - ${{env.CLIENT_FOLDER}} - build-the-samples-and-run-tests: - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - operating-system: [windows-latest,windows-2019] - net-framework-version: [4.6.1,4.6.2,4.7,4.7.1,4.7.2,4.8,4.8.1] - exclude: - - operating-system: windows-2019 - net-framework-version: 4.8.1 - - operating-system: windows-latest - net-framework-version: 4.6.1 - needs: build-the-dotnet-client # to make sure these jobs only start once the already present jobs are done running - runs-on: ${{matrix.operating-system}} - steps: - - name: Download the Built Rest Client for Dotnet from previous Job - uses: actions/download-artifact@v4 - with: - name: dotnet-build - path: ${{env.CLIENT_FOLDER}} - - name: Checkout cybersource-rest-samples-csharp repo - uses: actions/checkout@v4 - with: - repository: 'CyberSource/cybersource-rest-samples-csharp' - ref: 'master' - path: ${{env.SAMPLE_FOLDER}} - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - name: Building the samples and Running the Tests - run: | - msbuild -version - cd $Env:SAMPLE_FOLDER - (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj - #Replaced the Dependency path to already built cybersource-rest-client-dotnet dll file which was downloaded to the runner - (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+()", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj - nuget install packages.config -OutputDirectory packages - msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" - cd bin/Release/net461 - Write-Output "Running Samples now" - ./SampleCode.exe -RunAll > testing_dotnet.log - Copy-Item ".\testing_dotnet.log" -Destination "..\..\..\" - Set-Location ..\..\.. - Move-Item -Path .\testing_dotnet.log -Destination .\output.log - shell: pwsh - - name: Using Report Generation Action - id: report-generation - uses: ./cybersource-rest-client-dotnet/.github/actions/generate-report - with: - lang: dotnet - sample-folder-name: ${{env.SAMPLE_FOLDER}} - log-file-name: output.log - - name: Upload Test Reports - uses: actions/upload-artifact@v4 - with: - name: sample-run-report-${{matrix.operating-system}}-dotnet-framework-ver-${{matrix.net-framework-version}} - path: | - ${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}} +# name: DOTNET BUILDS +# on: +# push: +# pull_request: +# workflow_dispatch: +# env: +# CLIENT_FOLDER: 'cybersource-rest-client-dotnet' +# SAMPLE_FOLDER: 'cybersource-rest-samples-csharp' +# jobs: +# build-the-dotnet-client: +# defaults: +# run: +# shell: bash +# runs-on: windows-2019 +# steps: +# - name: Checkout cybersource-rest-client-dotnet repo +# uses: actions/checkout@v4 +# with: +# path: ${{env.CLIENT_FOLDER}} +# - name: Setup MSBuild +# uses: microsoft/setup-msbuild@v2 +# - name: Building the Dotnet Client +# run: | +# cd $Env:CLIENT_FOLDER +# nuget install packages.config -OutputDirectory packages +# nuget install ./test/packages.config -OutputDirectory packages +# msbuild -version +# msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" +# Write-Output "Build Successful" +# shell: pwsh +# - name: Upload the Dotnet Rest Client Build +# uses: actions/upload-artifact@v4 +# with: +# name: dotnet-build # discuss with Gaurav and Gabriel about naming of the dll artifacts +# path: | +# ${{env.CLIENT_FOLDER}} +# build-the-samples-and-run-tests: +# defaults: +# run: +# shell: bash +# strategy: +# fail-fast: false +# matrix: +# operating-system: [windows-latest,windows-2019] +# net-framework-version: [4.6.1,4.6.2,4.7,4.7.1,4.7.2,4.8,4.8.1] +# exclude: +# - operating-system: windows-2019 +# net-framework-version: 4.8.1 +# - operating-system: windows-latest +# net-framework-version: 4.6.1 +# needs: build-the-dotnet-client # to make sure these jobs only start once the already present jobs are done running +# runs-on: ${{matrix.operating-system}} +# steps: +# - name: Download the Built Rest Client for Dotnet from previous Job +# uses: actions/download-artifact@v4 +# with: +# name: dotnet-build +# path: ${{env.CLIENT_FOLDER}} +# - name: Checkout cybersource-rest-samples-csharp repo +# uses: actions/checkout@v4 +# with: +# repository: 'CyberSource/cybersource-rest-samples-csharp' +# ref: 'master' +# path: ${{env.SAMPLE_FOLDER}} +# - name: Setup MSBuild +# uses: microsoft/setup-msbuild@v2 +# - name: Building the samples and Running the Tests +# run: | +# msbuild -version +# cd $Env:SAMPLE_FOLDER +# (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj +# #Replaced the Dependency path to already built cybersource-rest-client-dotnet dll file which was downloaded to the runner +# (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+()", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj +# nuget install packages.config -OutputDirectory packages +# msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" +# cd bin/Release/net461 +# Write-Output "Running Samples now" +# ./SampleCode.exe -RunAll > testing_dotnet.log +# Copy-Item ".\testing_dotnet.log" -Destination "..\..\..\" +# Set-Location ..\..\.. +# Move-Item -Path .\testing_dotnet.log -Destination .\output.log +# shell: pwsh +# - name: Using Report Generation Action +# id: report-generation +# uses: ./cybersource-rest-client-dotnet/.github/actions/generate-report +# with: +# lang: dotnet +# sample-folder-name: ${{env.SAMPLE_FOLDER}} +# log-file-name: output.log +# - name: Upload Test Reports +# uses: actions/upload-artifact@v4 +# with: +# name: sample-run-report-${{matrix.operating-system}}-dotnet-framework-ver-${{matrix.net-framework-version}} +# path: | +# ${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}} From 1a00e236bb5f82cb44d5112d0b76b3ee4c3ce048 Mon Sep 17 00:00:00 2001 From: monkumar Date: Wed, 28 Aug 2024 12:28:03 +0530 Subject: [PATCH 36/42] Uploading built DLL only --- .github/workflows/workflow.yml | 190 ++++++++++++++++----------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 32a119a9..047df605 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,95 +1,95 @@ -# name: DOTNET BUILDS -# on: -# push: -# pull_request: -# workflow_dispatch: -# env: -# CLIENT_FOLDER: 'cybersource-rest-client-dotnet' -# SAMPLE_FOLDER: 'cybersource-rest-samples-csharp' -# jobs: -# build-the-dotnet-client: -# defaults: -# run: -# shell: bash -# runs-on: windows-2019 -# steps: -# - name: Checkout cybersource-rest-client-dotnet repo -# uses: actions/checkout@v4 -# with: -# path: ${{env.CLIENT_FOLDER}} -# - name: Setup MSBuild -# uses: microsoft/setup-msbuild@v2 -# - name: Building the Dotnet Client -# run: | -# cd $Env:CLIENT_FOLDER -# nuget install packages.config -OutputDirectory packages -# nuget install ./test/packages.config -OutputDirectory packages -# msbuild -version -# msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" -# Write-Output "Build Successful" -# shell: pwsh -# - name: Upload the Dotnet Rest Client Build -# uses: actions/upload-artifact@v4 -# with: -# name: dotnet-build # discuss with Gaurav and Gabriel about naming of the dll artifacts -# path: | -# ${{env.CLIENT_FOLDER}} -# build-the-samples-and-run-tests: -# defaults: -# run: -# shell: bash -# strategy: -# fail-fast: false -# matrix: -# operating-system: [windows-latest,windows-2019] -# net-framework-version: [4.6.1,4.6.2,4.7,4.7.1,4.7.2,4.8,4.8.1] -# exclude: -# - operating-system: windows-2019 -# net-framework-version: 4.8.1 -# - operating-system: windows-latest -# net-framework-version: 4.6.1 -# needs: build-the-dotnet-client # to make sure these jobs only start once the already present jobs are done running -# runs-on: ${{matrix.operating-system}} -# steps: -# - name: Download the Built Rest Client for Dotnet from previous Job -# uses: actions/download-artifact@v4 -# with: -# name: dotnet-build -# path: ${{env.CLIENT_FOLDER}} -# - name: Checkout cybersource-rest-samples-csharp repo -# uses: actions/checkout@v4 -# with: -# repository: 'CyberSource/cybersource-rest-samples-csharp' -# ref: 'master' -# path: ${{env.SAMPLE_FOLDER}} -# - name: Setup MSBuild -# uses: microsoft/setup-msbuild@v2 -# - name: Building the samples and Running the Tests -# run: | -# msbuild -version -# cd $Env:SAMPLE_FOLDER -# (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj -# #Replaced the Dependency path to already built cybersource-rest-client-dotnet dll file which was downloaded to the runner -# (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+()", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj -# nuget install packages.config -OutputDirectory packages -# msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" -# cd bin/Release/net461 -# Write-Output "Running Samples now" -# ./SampleCode.exe -RunAll > testing_dotnet.log -# Copy-Item ".\testing_dotnet.log" -Destination "..\..\..\" -# Set-Location ..\..\.. -# Move-Item -Path .\testing_dotnet.log -Destination .\output.log -# shell: pwsh -# - name: Using Report Generation Action -# id: report-generation -# uses: ./cybersource-rest-client-dotnet/.github/actions/generate-report -# with: -# lang: dotnet -# sample-folder-name: ${{env.SAMPLE_FOLDER}} -# log-file-name: output.log -# - name: Upload Test Reports -# uses: actions/upload-artifact@v4 -# with: -# name: sample-run-report-${{matrix.operating-system}}-dotnet-framework-ver-${{matrix.net-framework-version}} -# path: | -# ${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}} +name: DOTNET BUILDS +on: + push: + pull_request: + workflow_dispatch: +env: + CLIENT_FOLDER: 'cybersource-rest-client-dotnet' + SAMPLE_FOLDER: 'cybersource-rest-samples-csharp' +jobs: + build-the-dotnet-client: + defaults: + run: + shell: bash + runs-on: windows-2019 + steps: + - name: Checkout cybersource-rest-client-dotnet repo + uses: actions/checkout@v4 + with: + path: ${{env.CLIENT_FOLDER}} + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + - name: Building the Dotnet Client + run: | + cd $Env:CLIENT_FOLDER + nuget install packages.config -OutputDirectory packages + nuget install ./test/packages.config -OutputDirectory packages + msbuild -version + msbuild -property:Configuration=Release "cybersource-rest-client-dotnet.sln" + Write-Output "Build Successful" + shell: pwsh + - name: Upload the Dotnet Rest Client Build + uses: actions/upload-artifact@v4 + with: + name: cybersource-rest-client-dotnet-dll # discuss with Gaurav and Gabriel about naming of the dll artifacts + path: | + ${{env.CLIENT_FOLDER}}/bin/Release/cybersource-rest-client-dotnet.dll + build-the-samples-and-run-tests: + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + operating-system: [windows-latest,windows-2019] + net-framework-version: [4.6.1,4.6.2,4.7,4.7.1,4.7.2,4.8,4.8.1] + exclude: + - operating-system: windows-2019 + net-framework-version: 4.8.1 + - operating-system: windows-latest + net-framework-version: 4.6.1 + needs: build-the-dotnet-client # to make sure these jobs only start once the already present jobs are done running + runs-on: ${{matrix.operating-system}} + steps: + - name: Download the Built Rest Client for Dotnet from previous Job + uses: actions/download-artifact@v4 + with: + name: cybersource-rest-client-dotnet-dll + path: ${{env.CLIENT_FOLDER}}/dlls + - name: Checkout cybersource-rest-samples-csharp repo + uses: actions/checkout@v4 + with: + repository: 'CyberSource/cybersource-rest-samples-csharp' + ref: 'master' + path: ${{env.SAMPLE_FOLDER}} + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + - name: Building the samples and Running the Tests + run: | + msbuild -version + cd $Env:SAMPLE_FOLDER + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\dlls\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj + #Replaced the Dependency path to already built cybersource-rest-client-dotnet dll file which was downloaded to the runner + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+()", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj + nuget install packages.config -OutputDirectory packages + msbuild -property:Configuration=Release "cybersource-rest-samples-csharp.sln" + cd bin/Release/net461 + Write-Output "Running Samples now" + ./SampleCode.exe -RunAll > testing_dotnet.log + Copy-Item ".\testing_dotnet.log" -Destination "..\..\..\" + Set-Location ..\..\.. + Move-Item -Path .\testing_dotnet.log -Destination .\output.log + shell: pwsh + - name: Using Report Generation Action + id: report-generation + uses: ./cybersource-rest-client-dotnet/.github/actions/generate-report + with: + lang: dotnet + sample-folder-name: ${{env.SAMPLE_FOLDER}} + log-file-name: output.log + - name: Upload Test Reports + uses: actions/upload-artifact@v4 + with: + name: sample-run-report-${{matrix.operating-system}}-dotnet-framework-ver-${{matrix.net-framework-version}} + path: | + ${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}} From 0ffc793e7dc98f8a4c050e858da3c84ec69d3de9 Mon Sep 17 00:00:00 2001 From: monkumar Date: Wed, 28 Aug 2024 12:36:38 +0530 Subject: [PATCH 37/42] Removing comment --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 047df605..237afaad 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -31,7 +31,7 @@ jobs: - name: Upload the Dotnet Rest Client Build uses: actions/upload-artifact@v4 with: - name: cybersource-rest-client-dotnet-dll # discuss with Gaurav and Gabriel about naming of the dll artifacts + name: cybersource-rest-client-dotnet-dll path: | ${{env.CLIENT_FOLDER}}/bin/Release/cybersource-rest-client-dotnet.dll build-the-samples-and-run-tests: From dabeaa88dc27b8995197b9518c527cab603d1b13 Mon Sep 17 00:00:00 2001 From: monkumar Date: Wed, 28 Aug 2024 13:21:48 +0530 Subject: [PATCH 38/42] correcting path and branch --- .github/workflows/workflow.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 237afaad..91c4cfc8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -31,9 +31,10 @@ jobs: - name: Upload the Dotnet Rest Client Build uses: actions/upload-artifact@v4 with: - name: cybersource-rest-client-dotnet-dll + name: cybersource-rest-client-dotnet-dll-and-action path: | ${{env.CLIENT_FOLDER}}/bin/Release/cybersource-rest-client-dotnet.dll + ${{env.CLIENT_FOLDER}}/.github/actions/generate-report build-the-samples-and-run-tests: defaults: run: @@ -54,13 +55,13 @@ jobs: - name: Download the Built Rest Client for Dotnet from previous Job uses: actions/download-artifact@v4 with: - name: cybersource-rest-client-dotnet-dll - path: ${{env.CLIENT_FOLDER}}/dlls + name: cybersource-rest-client-dotnet-dll-and-action + path: dlls-and-action - name: Checkout cybersource-rest-samples-csharp repo uses: actions/checkout@v4 with: repository: 'CyberSource/cybersource-rest-samples-csharp' - ref: 'master' + ref: 'testing-branch' path: ${{env.SAMPLE_FOLDER}} - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 @@ -68,7 +69,7 @@ jobs: run: | msbuild -version cd $Env:SAMPLE_FOLDER - (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\cybersource-rest-client-dotnet\\dlls\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "dlls-and-action\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj #Replaced the Dependency path to already built cybersource-rest-client-dotnet dll file which was downloaded to the runner (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+()", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj nuget install packages.config -OutputDirectory packages @@ -82,7 +83,7 @@ jobs: shell: pwsh - name: Using Report Generation Action id: report-generation - uses: ./cybersource-rest-client-dotnet/.github/actions/generate-report + uses: ./dlls-and-action/generate-report with: lang: dotnet sample-folder-name: ${{env.SAMPLE_FOLDER}} From 004d64fe5f4d252d87c7f846509182781398486e Mon Sep 17 00:00:00 2001 From: monkumar Date: Wed, 28 Aug 2024 14:25:00 +0530 Subject: [PATCH 39/42] correcting paths --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 91c4cfc8..6353659b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -31,7 +31,7 @@ jobs: - name: Upload the Dotnet Rest Client Build uses: actions/upload-artifact@v4 with: - name: cybersource-rest-client-dotnet-dll-and-action + name: cybersource-rest-client-dotnet-dll-and-action path: | ${{env.CLIENT_FOLDER}}/bin/Release/cybersource-rest-client-dotnet.dll ${{env.CLIENT_FOLDER}}/.github/actions/generate-report @@ -69,7 +69,7 @@ jobs: run: | msbuild -version cd $Env:SAMPLE_FOLDER - (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "dlls-and-action\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj + (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+(cybersource-rest-client-dotnet.dll)", "..\\dlls-and-action\\bin\\Release\\cybersource-rest-client-dotnet.dll" } | Set-Content ./cybersource-rest-samples-csharp.csproj #Replaced the Dependency path to already built cybersource-rest-client-dotnet dll file which was downloaded to the runner (Get-Content ./cybersource-rest-samples-csharp.csproj) | ForEach-Object { $_ -replace "()(.)+()", "v${{matrix.net-framework-version}}" } | Set-Content ./cybersource-rest-samples-csharp.csproj nuget install packages.config -OutputDirectory packages @@ -83,7 +83,7 @@ jobs: shell: pwsh - name: Using Report Generation Action id: report-generation - uses: ./dlls-and-action/generate-report + uses: ./dlls-and-action/.github/actions/generate-report with: lang: dotnet sample-folder-name: ${{env.SAMPLE_FOLDER}} From fedfa2b78ba4591c54f57b221f9f208845600f4f Mon Sep 17 00:00:00 2001 From: monkumar Date: Wed, 28 Aug 2024 14:40:33 +0530 Subject: [PATCH 40/42] changed sample branch --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6353659b..d3d2bebe 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -61,7 +61,7 @@ jobs: uses: actions/checkout@v4 with: repository: 'CyberSource/cybersource-rest-samples-csharp' - ref: 'testing-branch' + ref: 'master' path: ${{env.SAMPLE_FOLDER}} - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 From 2cf1e56825543809c32e6fecbdc3ab1b598938e1 Mon Sep 17 00:00:00 2001 From: monkumar Date: Thu, 29 Aug 2024 14:28:24 +0530 Subject: [PATCH 41/42] checking different version --- cybersource-rest-client-dotnet.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cybersource-rest-client-dotnet.nuspec b/cybersource-rest-client-dotnet.nuspec index bc21fb79..c83c99b6 100644 --- a/cybersource-rest-client-dotnet.nuspec +++ b/cybersource-rest-client-dotnet.nuspec @@ -2,7 +2,7 @@ CyberSource.Rest.Client - 0.0.1.44 + 0.0.1.90 CyberSource.Rest.Client CyberSource Corporation CyberSource From de7ddddc4a7e982c800aadb2b00f87d6aa216fbb Mon Sep 17 00:00:00 2001 From: monkumar Date: Thu, 29 Aug 2024 14:29:52 +0530 Subject: [PATCH 42/42] Revert "checking different version" This reverts commit 2cf1e56825543809c32e6fecbdc3ab1b598938e1. --- cybersource-rest-client-dotnet.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cybersource-rest-client-dotnet.nuspec b/cybersource-rest-client-dotnet.nuspec index c83c99b6..bc21fb79 100644 --- a/cybersource-rest-client-dotnet.nuspec +++ b/cybersource-rest-client-dotnet.nuspec @@ -2,7 +2,7 @@ CyberSource.Rest.Client - 0.0.1.90 + 0.0.1.44 CyberSource.Rest.Client CyberSource Corporation CyberSource