From 4176e987b1a20e2cb042fce1bb9e3e570e263a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Sun, 19 Jun 2022 17:59:46 +0200 Subject: [PATCH 01/20] setting headless mode --- .github/actions/test-dotnet/run-tests.ps1 | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/actions/test-dotnet/run-tests.ps1 b/.github/actions/test-dotnet/run-tests.ps1 index 186a4fdc3..c6f08414e 100644 --- a/.github/actions/test-dotnet/run-tests.ps1 +++ b/.github/actions/test-dotnet/run-tests.ps1 @@ -1,7 +1,5 @@ param ($Verbosity) -function Configure-Environment($hash) { Set-Item @hash } - # First, we globally set test configurations using environment variables. Then acquire the list of all test projects # (excluding the two test libraries) and then run each until one fails or all concludes. If a test fails, the output is # sanitized from unnecessary diagnostics messages from chromedriver if the output doesn't already contain groupings, @@ -12,23 +10,19 @@ function Configure-Environment($hash) { Set-Item @hash } if ($Env:RUNNER_OS -eq "Windows") { - Configure-Environment @{ - Path = 'Env:\Lombiq_Tests_UI__SqlServerDatabaseConfiguration__ConnectionStringTemplate' - Value = 'Server=.\SQLEXPRESS;Database=LombiqUITestingToolbox_{{id}};Integrated Security=True;MultipleActiveResultSets=True;Connection Timeout=60;ConnectRetryCount=15;ConnectRetryInterval=5' - } + $Env:Lombiq_Tests_UI__SqlServerDatabaseConfiguration__ConnectionStringTemplate = + 'Server=.\SQLEXPRESS;Database=LombiqUITestingToolbox_{{id}};Integrated Security=True;MultipleActiveResultSets=True;Connection Timeout=60;ConnectRetryCount=15;ConnectRetryInterval=5' } else { - Configure-Environment @{ - Path = 'Env:\Lombiq_Tests_UI__SqlServerDatabaseConfiguration__ConnectionStringTemplate' - Value = 'Server=.;Database=LombiqUITestingToolbox_{{id}};User Id=sa;Password=Password1!;MultipleActiveResultSets=True;Connection Timeout=60;ConnectRetryCount=15;ConnectRetryInterval=5' - } - Configure-Environment @{ - Path = 'Env:\Lombiq_Tests_UI__DockerConfiguration__ContainerName' - Value = 'sql2019' - } + $Env:Lombiq_Tests_UI__SqlServerDatabaseConfiguration__ConnectionStringTemplate = + 'Server=.;Database=LombiqUITestingToolbox_{{id}};User Id=sa;Password=Password1!;MultipleActiveResultSets=True;Connection Timeout=60;ConnectRetryCount=15;ConnectRetryInterval=5' + + $Env:Lombiq_Tests_UI__DockerConfiguration__ContainerName = 'sql2019' } +$Env:Lombiq_Tests_UI__BrowserConfiguration__Headless = 'true' + $tests = dotnet sln list | Select-Object -Skip 2 | Select-String '\.Tests\.' | From 9ce2cabbb93843fb55ec2b2cb19fc563a718c40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Sun, 19 Jun 2022 20:38:29 +0200 Subject: [PATCH 02/20] changing sing to double quotes --- .github/actions/test-dotnet/run-tests.ps1 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/test-dotnet/run-tests.ps1 b/.github/actions/test-dotnet/run-tests.ps1 index c6f08414e..c712129ed 100644 --- a/.github/actions/test-dotnet/run-tests.ps1 +++ b/.github/actions/test-dotnet/run-tests.ps1 @@ -3,7 +3,7 @@ # First, we globally set test configurations using environment variables. Then acquire the list of all test projects # (excluding the two test libraries) and then run each until one fails or all concludes. If a test fails, the output is # sanitized from unnecessary diagnostics messages from chromedriver if the output doesn't already contain groupings, -# then it wraps them in '::group::'. If there are already groupings, then it is not possible to nest them +# then it wraps them in "::group::". If there are already groupings, then it is not possible to nest them # (https://github.com/actions/runner/issues/802) so that's omitted. The groupings make the output collapsible region on # the Actions web UI. Note that we use bash to output the log using bash to avoid pwsh wrapping the output to the # default buffer width. @@ -11,26 +11,26 @@ if ($Env:RUNNER_OS -eq "Windows") { $Env:Lombiq_Tests_UI__SqlServerDatabaseConfiguration__ConnectionStringTemplate = - 'Server=.\SQLEXPRESS;Database=LombiqUITestingToolbox_{{id}};Integrated Security=True;MultipleActiveResultSets=True;Connection Timeout=60;ConnectRetryCount=15;ConnectRetryInterval=5' + "Server=.\SQLEXPRESS;Database=LombiqUITestingToolbox_{{id}};Integrated Security=True;MultipleActiveResultSets=True;Connection Timeout=60;ConnectRetryCount=15;ConnectRetryInterval=5" } else { $Env:Lombiq_Tests_UI__SqlServerDatabaseConfiguration__ConnectionStringTemplate = - 'Server=.;Database=LombiqUITestingToolbox_{{id}};User Id=sa;Password=Password1!;MultipleActiveResultSets=True;Connection Timeout=60;ConnectRetryCount=15;ConnectRetryInterval=5' + "Server=.;Database=LombiqUITestingToolbox_{{id}};User Id=sa;Password=Password1!;MultipleActiveResultSets=True;Connection Timeout=60;ConnectRetryCount=15;ConnectRetryInterval=5" - $Env:Lombiq_Tests_UI__DockerConfiguration__ContainerName = 'sql2019' + $Env:Lombiq_Tests_UI__DockerConfiguration__ContainerName = "sql2019" } -$Env:Lombiq_Tests_UI__BrowserConfiguration__Headless = 'true' +$Env:Lombiq_Tests_UI__BrowserConfiguration__Headless = "true" $tests = dotnet sln list | Select-Object -Skip 2 | - Select-String '\.Tests\.' | - Select-String -NotMatch 'Lombiq.Tests.UI.csproj' | - Select-String -NotMatch 'Lombiq.Tests.csproj' | + Select-String "\.Tests\." | + Select-String -NotMatch "Lombiq.Tests.UI.csproj" | + Select-String -NotMatch "Lombiq.Tests.csproj" | ? { $result = dotnet test --no-restore --list-tests --verbosity $Verbosity $_ 2>&1 | Out-String -Width 9999 - -not [string]::IsNullOrEmpty($result) -and $result.Contains('The following Tests are available') + -not [string]::IsNullOrEmpty($result) -and $result.Contains("The following Tests are available") } foreach ($test in $tests) { @@ -42,7 +42,7 @@ foreach ($test in $tests) { continue } - $needsGrouping = (Select-String '::group::' test.out).Length -eq 0 + $needsGrouping = (Select-String "::group::" test.out).Length -eq 0 if ($needsGrouping) { echo "::group::Test Failed: $test" } From 42394081ee39edfa28758aec30351ad4a6d925e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Mon, 20 Jun 2022 08:33:49 +0200 Subject: [PATCH 03/20] changing Tests to issue/OSOE-111 --- .github/workflows/build-and-test-orchard-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 4bcc721f8..06e046a6d 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -80,7 +80,7 @@ jobs: location: ${{ inputs.build-directory}} - name: Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-111 with: build-directory: ${{ inputs.build-directory}} test-verbosity: ${{ inputs.build-verbosity}} From 74c0246c899b94b56c460e921994a634ee97268a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 17:53:37 +0200 Subject: [PATCH 04/20] adding setup-edge action --- .github/actions/setup-edge/action.yml | 20 +++++++++++++++++++ .github/actions/setup-edge/setup-edge.ps1 | 20 +++++++++++++++++++ .../workflows/build-and-test-orchard-core.yml | 3 +++ 3 files changed, 43 insertions(+) create mode 100644 .github/actions/setup-edge/action.yml create mode 100644 .github/actions/setup-edge/setup-edge.ps1 diff --git a/.github/actions/setup-edge/action.yml b/.github/actions/setup-edge/action.yml new file mode 100644 index 000000000..21892c46c --- /dev/null +++ b/.github/actions/setup-edge/action.yml @@ -0,0 +1,20 @@ +name: Set up Microsoft Edge +description: Sets up Microsoft Edge. + +inputs: + edge-linux-version: + required: false + default: 102.0.1245.39-1 + description: Version of Microsoft Edge to set up on Linux. + edge-windows-version: + required: false + default: 102.0.1245.39 + description: Version of Microsoft Edge to set up on Linux. + +runs: + using: "composite" + steps: + - name: Set up Microsoft Edge + shell: pwsh + run: | + ${{ github.action_path }}/setup-edge.ps1 ${{ inputs.edge-linux-version }} ${{ inputs.edge-windows-version }} diff --git a/.github/actions/setup-edge/setup-edge.ps1 b/.github/actions/setup-edge/setup-edge.ps1 new file mode 100644 index 000000000..33dd708d1 --- /dev/null +++ b/.github/actions/setup-edge/setup-edge.ps1 @@ -0,0 +1,20 @@ +function Program { + param( + [string] + $EdgeLinuxVersion, + [string] + $EdgeWindowsVersion, + ) + + if ($Env:RUNNER_OS -eq "Windows") + { + choco install microsoft-edge --version $EdgeWindowsVersion -y + } + else + { + bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_$EdgeLinuxVersion_amd64.deb" + bash -c "sudo apt install ./microsoft-edge-stable_$EdgeLinuxVersion_amd64.deb" + } +} + +Program $args[0] $args[1] diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index c946244c5..27250223a 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -77,6 +77,9 @@ jobs: with: submodules: 'recursive' + - name: Set up Edge + uses: Lombiq/GitHub-Actions/.github/actions/setup-edge@issue/OSOE-111 + - name: Set up .NET uses: Lombiq/GitHub-Actions/.github/actions/setup-dotnet@dev with: From ea2dd0dad18d9167030246d73612dde80c368444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 17:57:17 +0200 Subject: [PATCH 05/20] fixing typo --- .github/actions/setup-edge/setup-edge.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-edge/setup-edge.ps1 b/.github/actions/setup-edge/setup-edge.ps1 index 33dd708d1..f24c92843 100644 --- a/.github/actions/setup-edge/setup-edge.ps1 +++ b/.github/actions/setup-edge/setup-edge.ps1 @@ -3,7 +3,7 @@ function Program { [string] $EdgeLinuxVersion, [string] - $EdgeWindowsVersion, + $EdgeWindowsVersion ) if ($Env:RUNNER_OS -eq "Windows") From 59668f162a82e33783403bc3f91eb3b443364f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 18:03:11 +0200 Subject: [PATCH 06/20] fix --- .github/actions/setup-edge/setup-edge.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-edge/setup-edge.ps1 b/.github/actions/setup-edge/setup-edge.ps1 index f24c92843..71329f7ef 100644 --- a/.github/actions/setup-edge/setup-edge.ps1 +++ b/.github/actions/setup-edge/setup-edge.ps1 @@ -12,8 +12,8 @@ function Program { } else { - bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_$EdgeLinuxVersion_amd64.deb" - bash -c "sudo apt install ./microsoft-edge-stable_$EdgeLinuxVersion_amd64.deb" + bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeLinuxVersion}_amd64.deb" + bash -c "sudo apt install ./microsoft-edge-stable_${EdgeLinuxVersion}_amd64.deb" } } From 6c6b664ac328959bcf5f0888291b204ca8ff942c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 18:29:22 +0200 Subject: [PATCH 07/20] edge version info --- .github/actions/setup-edge/setup-edge.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-edge/setup-edge.ps1 b/.github/actions/setup-edge/setup-edge.ps1 index 71329f7ef..43984ae75 100644 --- a/.github/actions/setup-edge/setup-edge.ps1 +++ b/.github/actions/setup-edge/setup-edge.ps1 @@ -8,7 +8,8 @@ function Program { if ($Env:RUNNER_OS -eq "Windows") { - choco install microsoft-edge --version $EdgeWindowsVersion -y + Get-AppxPackage -Name "Microsoft.MicrosoftEdge.Stable" + #choco install microsoft-edge --version $EdgeWindowsVersion -y } else { From 622881ed22322b66607200a53b71b4616625e33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 19:05:12 +0200 Subject: [PATCH 08/20] get edge version again --- .github/actions/setup-edge/setup-edge.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-edge/setup-edge.ps1 b/.github/actions/setup-edge/setup-edge.ps1 index 43984ae75..76d2a227d 100644 --- a/.github/actions/setup-edge/setup-edge.ps1 +++ b/.github/actions/setup-edge/setup-edge.ps1 @@ -8,8 +8,16 @@ function Program { if ($Env:RUNNER_OS -eq "Windows") { - Get-AppxPackage -Name "Microsoft.MicrosoftEdge.Stable" - #choco install microsoft-edge --version $EdgeWindowsVersion -y + $installedVersion = (Get-ItemProperty -Path HKCU:\Software\Microsoft\Edge\BLBeacon -Name version).version + + if ([string]::IsNullOrEmpty($installedVersion)) + { + #choco install microsoft-edge --version $EdgeWindowsVersion -y + } + else + { + Write-Output "Installed edge version: ${installedVersion}" + } } else { From 90b89d8ecce80dba21414780753cfa18ad3e7081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 19:33:03 +0200 Subject: [PATCH 09/20] test without install --- .github/actions/setup-edge/setup-edge.ps1 | 33 ++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/actions/setup-edge/setup-edge.ps1 b/.github/actions/setup-edge/setup-edge.ps1 index 76d2a227d..5d64b22ff 100644 --- a/.github/actions/setup-edge/setup-edge.ps1 +++ b/.github/actions/setup-edge/setup-edge.ps1 @@ -1,3 +1,27 @@ +function Get-ProcessOutput +{ + Param ( + [Parameter(Mandatory=$true)]$FileName, + $Args + ) + + $process = New-Object System.Diagnostics.Process + $process.StartInfo.UseShellExecute = $false + $process.StartInfo.RedirectStandardOutput = $true + $process.StartInfo.RedirectStandardError = $true + $process.StartInfo.FileName = $FileName + if($Args) { $process.StartInfo.Arguments = $Args } + $out = $process.Start() + + $StandardError = $process.StandardError.ReadToEnd() + $StandardOutput = $process.StandardOutput.ReadToEnd() + + $output = New-Object PSObject + $output | Add-Member -type NoteProperty -name StandardOutput -Value $StandardOutput + $output | Add-Member -type NoteProperty -name StandardError -Value $StandardError + return $output +} + function Program { param( [string] @@ -8,16 +32,7 @@ function Program { if ($Env:RUNNER_OS -eq "Windows") { - $installedVersion = (Get-ItemProperty -Path HKCU:\Software\Microsoft\Edge\BLBeacon -Name version).version - if ([string]::IsNullOrEmpty($installedVersion)) - { - #choco install microsoft-edge --version $EdgeWindowsVersion -y - } - else - { - Write-Output "Installed edge version: ${installedVersion}" - } } else { From 79d330176926552e9f07da7e5451466d4f72079a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 20:30:29 +0200 Subject: [PATCH 10/20] setup edge only on linux --- .../action.yml | 11 ++--- .../actions/setup-edge-linux/setup-edge.ps1 | 11 +++++ .github/actions/setup-edge/setup-edge.ps1 | 44 ------------------- .../workflows/build-and-test-orchard-core.yml | 2 +- 4 files changed, 16 insertions(+), 52 deletions(-) rename .github/actions/{setup-edge => setup-edge-linux}/action.yml (57%) create mode 100644 .github/actions/setup-edge-linux/setup-edge.ps1 delete mode 100644 .github/actions/setup-edge/setup-edge.ps1 diff --git a/.github/actions/setup-edge/action.yml b/.github/actions/setup-edge-linux/action.yml similarity index 57% rename from .github/actions/setup-edge/action.yml rename to .github/actions/setup-edge-linux/action.yml index 21892c46c..ad797265d 100644 --- a/.github/actions/setup-edge/action.yml +++ b/.github/actions/setup-edge-linux/action.yml @@ -1,20 +1,17 @@ -name: Set up Microsoft Edge +name: Set up Microsoft Edge on Linux description: Sets up Microsoft Edge. inputs: - edge-linux-version: + edge-version: required: false default: 102.0.1245.39-1 description: Version of Microsoft Edge to set up on Linux. - edge-windows-version: - required: false - default: 102.0.1245.39 - description: Version of Microsoft Edge to set up on Linux. runs: using: "composite" steps: - name: Set up Microsoft Edge + if: {{ runner.os == 'Linux' }} shell: pwsh run: | - ${{ github.action_path }}/setup-edge.ps1 ${{ inputs.edge-linux-version }} ${{ inputs.edge-windows-version }} + ${{ github.action_path }}/setup-edge.ps1 ${{ inputs.edge-version }} diff --git a/.github/actions/setup-edge-linux/setup-edge.ps1 b/.github/actions/setup-edge-linux/setup-edge.ps1 new file mode 100644 index 000000000..c82080835 --- /dev/null +++ b/.github/actions/setup-edge-linux/setup-edge.ps1 @@ -0,0 +1,11 @@ +function Program { + param( + [string] + $EdgeVersion + ) + + bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeLinuxVersion}_amd64.deb" + bash -c "sudo apt install ./microsoft-edge-stable_${EdgeLinuxVersion}_amd64.deb" +} + +Program $args[0] diff --git a/.github/actions/setup-edge/setup-edge.ps1 b/.github/actions/setup-edge/setup-edge.ps1 deleted file mode 100644 index 5d64b22ff..000000000 --- a/.github/actions/setup-edge/setup-edge.ps1 +++ /dev/null @@ -1,44 +0,0 @@ -function Get-ProcessOutput -{ - Param ( - [Parameter(Mandatory=$true)]$FileName, - $Args - ) - - $process = New-Object System.Diagnostics.Process - $process.StartInfo.UseShellExecute = $false - $process.StartInfo.RedirectStandardOutput = $true - $process.StartInfo.RedirectStandardError = $true - $process.StartInfo.FileName = $FileName - if($Args) { $process.StartInfo.Arguments = $Args } - $out = $process.Start() - - $StandardError = $process.StandardError.ReadToEnd() - $StandardOutput = $process.StandardOutput.ReadToEnd() - - $output = New-Object PSObject - $output | Add-Member -type NoteProperty -name StandardOutput -Value $StandardOutput - $output | Add-Member -type NoteProperty -name StandardError -Value $StandardError - return $output -} - -function Program { - param( - [string] - $EdgeLinuxVersion, - [string] - $EdgeWindowsVersion - ) - - if ($Env:RUNNER_OS -eq "Windows") - { - - } - else - { - bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeLinuxVersion}_amd64.deb" - bash -c "sudo apt install ./microsoft-edge-stable_${EdgeLinuxVersion}_amd64.deb" - } -} - -Program $args[0] $args[1] diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 27250223a..b127738e4 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -78,7 +78,7 @@ jobs: submodules: 'recursive' - name: Set up Edge - uses: Lombiq/GitHub-Actions/.github/actions/setup-edge@issue/OSOE-111 + uses: Lombiq/GitHub-Actions/.github/actions/setup-edge-linux@issue/OSOE-111 - name: Set up .NET uses: Lombiq/GitHub-Actions/.github/actions/setup-dotnet@dev From 5d22d1dde873fea99015842e05c5226ee180a6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 20:33:10 +0200 Subject: [PATCH 11/20] fixing typo --- .github/actions/setup-edge-linux/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-edge-linux/action.yml b/.github/actions/setup-edge-linux/action.yml index ad797265d..668a1878d 100644 --- a/.github/actions/setup-edge-linux/action.yml +++ b/.github/actions/setup-edge-linux/action.yml @@ -11,7 +11,7 @@ runs: using: "composite" steps: - name: Set up Microsoft Edge - if: {{ runner.os == 'Linux' }} + if: ${{ runner.os == 'Linux' }} shell: pwsh run: | ${{ github.action_path }}/setup-edge.ps1 ${{ inputs.edge-version }} From 316ff481f117660a9d57426fa9eb38419a943ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 20:35:59 +0200 Subject: [PATCH 12/20] fixing variable name --- .github/actions/setup-edge-linux/setup-edge.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-edge-linux/setup-edge.ps1 b/.github/actions/setup-edge-linux/setup-edge.ps1 index c82080835..d818ba897 100644 --- a/.github/actions/setup-edge-linux/setup-edge.ps1 +++ b/.github/actions/setup-edge-linux/setup-edge.ps1 @@ -4,8 +4,8 @@ function Program { $EdgeVersion ) - bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeLinuxVersion}_amd64.deb" - bash -c "sudo apt install ./microsoft-edge-stable_${EdgeLinuxVersion}_amd64.deb" + bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeVersion}_amd64.deb" + bash -c "sudo apt install ./microsoft-edge-stable_${EdgeVersion}_amd64.deb" } Program $args[0] From 978bcafb0fb34e968e6d4c8db0259b0da5040c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Tue, 28 Jun 2022 20:57:07 +0200 Subject: [PATCH 13/20] adding edge to gh path --- .github/actions/setup-edge-linux/setup-edge.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup-edge-linux/setup-edge.ps1 b/.github/actions/setup-edge-linux/setup-edge.ps1 index d818ba897..92856bace 100644 --- a/.github/actions/setup-edge-linux/setup-edge.ps1 +++ b/.github/actions/setup-edge-linux/setup-edge.ps1 @@ -6,6 +6,8 @@ function Program { bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeVersion}_amd64.deb" bash -c "sudo apt install ./microsoft-edge-stable_${EdgeVersion}_amd64.deb" + + echo "/opt/microsoft/msedge" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append } Program $args[0] From 139e0ed3b751f753d9d26a885be38dc115e10456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Wed, 29 Jun 2022 09:12:28 +0200 Subject: [PATCH 14/20] comments --- .github/actions/setup-edge-linux/action.yml | 2 +- .github/workflows/build-and-test-orchard-core.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-edge-linux/action.yml b/.github/actions/setup-edge-linux/action.yml index 668a1878d..2376c2645 100644 --- a/.github/actions/setup-edge-linux/action.yml +++ b/.github/actions/setup-edge-linux/action.yml @@ -1,5 +1,5 @@ name: Set up Microsoft Edge on Linux -description: Sets up Microsoft Edge. +description: Sets up Microsoft Edge on Linux. inputs: edge-version: diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index b127738e4..8cbd888fd 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -76,7 +76,9 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' - + # Firefox and Chrome browsers are installed by default on ubuntu-latest and windows-latest, and Edge is installed by + # default on windows-latest, so here we install Edge on ubuntu-latest. It seems Linux support is planned here + # (https://github.com/browser-actions/setup-edge), after this completes we can use it. - name: Set up Edge uses: Lombiq/GitHub-Actions/.github/actions/setup-edge-linux@issue/OSOE-111 From 80d5b8bdefb0750330982dc8e343772862d45572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horv=C3=A1th=20J=C3=B3zsef?= Date: Thu, 30 Jun 2022 00:08:23 +0200 Subject: [PATCH 15/20] Update .github/actions/setup-edge-linux/setup-edge.ps1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Zoltán Lehóczky --- .github/actions/setup-edge-linux/setup-edge.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-edge-linux/setup-edge.ps1 b/.github/actions/setup-edge-linux/setup-edge.ps1 index 92856bace..269593363 100644 --- a/.github/actions/setup-edge-linux/setup-edge.ps1 +++ b/.github/actions/setup-edge-linux/setup-edge.ps1 @@ -7,7 +7,7 @@ function Program { bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeVersion}_amd64.deb" bash -c "sudo apt install ./microsoft-edge-stable_${EdgeVersion}_amd64.deb" - echo "/opt/microsoft/msedge" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + Write-Output "/opt/microsoft/msedge" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append } Program $args[0] From d88ad0b56381ce36f53c2a900e92932b626424e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Thu, 30 Jun 2022 00:51:52 +0200 Subject: [PATCH 16/20] adding conditional setup edge on linux adding tool request issue link --- .../actions/setup-edge-linux/setup-edge.ps1 | 18 ++++++++---------- .../workflows/build-and-test-orchard-core.yml | 12 +++++++++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/actions/setup-edge-linux/setup-edge.ps1 b/.github/actions/setup-edge-linux/setup-edge.ps1 index 269593363..8f68174d1 100644 --- a/.github/actions/setup-edge-linux/setup-edge.ps1 +++ b/.github/actions/setup-edge-linux/setup-edge.ps1 @@ -1,13 +1,11 @@ -function Program { - param( - [string] - $EdgeVersion - ) +# Issue for tool request: https://github.com/actions/virtual-environments/issues/5845. - bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeVersion}_amd64.deb" - bash -c "sudo apt install ./microsoft-edge-stable_${EdgeVersion}_amd64.deb" +param( + [string] + $EdgeVersion +) - Write-Output "/opt/microsoft/msedge" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append -} +bash -c "curl -O https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_${EdgeVersion}_amd64.deb" +bash -c "sudo apt install ./microsoft-edge-stable_${EdgeVersion}_amd64.deb" -Program $args[0] +Write-Output "/opt/microsoft/msedge" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 8cbd888fd..91ef9a1d2 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -59,6 +59,11 @@ on: type: number default: 360 description: Configuration for the timeout-minutes parameter of the workflow. The 360 is GitHub's default. + setup-edge-on-linux: + required: false + type: boolean + default: false + description: Indicates whether to enable setup Edge on Linux. jobs: build-and-test: @@ -73,14 +78,15 @@ jobs: - ${{ inputs.timeout-minutes }} timeout-minutes: ${{ matrix.timeout-minutes }} steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' # Firefox and Chrome browsers are installed by default on ubuntu-latest and windows-latest, and Edge is installed by # default on windows-latest, so here we install Edge on ubuntu-latest. It seems Linux support is planned here # (https://github.com/browser-actions/setup-edge), after this completes we can use it. - name: Set up Edge uses: Lombiq/GitHub-Actions/.github/actions/setup-edge-linux@issue/OSOE-111 + if: ${{ inputs.setup-edge-on-linux }} + - uses: actions/checkout@v3 + with: + submodules: 'recursive' - name: Set up .NET uses: Lombiq/GitHub-Actions/.github/actions/setup-dotnet@dev From 9f9b9f2a18430dda4d45a50c5a9d0514972903e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Thu, 30 Jun 2022 00:57:18 +0200 Subject: [PATCH 17/20] moving setup edge before test step --- .github/workflows/build-and-test-orchard-core.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 91ef9a1d2..a22a9e99e 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -78,12 +78,6 @@ jobs: - ${{ inputs.timeout-minutes }} timeout-minutes: ${{ matrix.timeout-minutes }} steps: - # Firefox and Chrome browsers are installed by default on ubuntu-latest and windows-latest, and Edge is installed by - # default on windows-latest, so here we install Edge on ubuntu-latest. It seems Linux support is planned here - # (https://github.com/browser-actions/setup-edge), after this completes we can use it. - - name: Set up Edge - uses: Lombiq/GitHub-Actions/.github/actions/setup-edge-linux@issue/OSOE-111 - if: ${{ inputs.setup-edge-on-linux }} - uses: actions/checkout@v3 with: submodules: 'recursive' @@ -114,6 +108,13 @@ jobs: with: location: ${{ inputs.build-directory}} + # Firefox and Chrome browsers are installed by default on ubuntu-latest and windows-latest, and Edge is installed by + # default on windows-latest, so here we install Edge on ubuntu-latest. It seems Linux support is planned here + # (https://github.com/browser-actions/setup-edge), after this completes we can use it. + - name: Set up Edge + uses: Lombiq/GitHub-Actions/.github/actions/setup-edge-linux@issue/OSOE-111 + if: ${{ inputs.setup-edge-on-linux }} + - name: Tests uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-111 with: From 47ba87304e663ded378f5291c79efabb97f99024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Thu, 30 Jun 2022 02:39:34 +0200 Subject: [PATCH 18/20] docs --- Docs/Actions.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Docs/Actions.md b/Docs/Actions.md index 59b125cfe..e0637d744 100644 --- a/Docs/Actions.md +++ b/Docs/Actions.md @@ -1,4 +1,4 @@ -# Composite GitHub Actions actions +# Composite GitHub Actions actions @@ -13,4 +13,5 @@ In addition to the below short explanations, check out the inline documentation - `setup-dotnet`: Sets up the .NET SDK. - `setup-sql-server`: Sets up SQL Server with Lombiq-recommended defaults. - `test-dotnet`: Runs .NET unit and UI tests (with the [Lombiq UI Testing Toolbox for Orchard Core](https://github.com/Lombiq/UI-Testing-Toolbox)), generates a test report, and uploads UI testing failure dumps to artifacts. -- `verify-submodule-pull-request`: Assuming that the current repository is a submodule in another repository, this action verifies that a pull request with a matching issue code has been opened there as well. \ No newline at end of file +- `verify-submodule-pull-request`: Assuming that the current repository is a submodule in another repository, this action verifies that a pull request with a matching issue code has been opened there as well. +- `setup-edge-linux`: Sets up the Microsoft Edge on Linux. From 85ecb6b45308187fc00c507fad5fccbc4516c0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Horv=C3=A1th?= Date: Thu, 30 Jun 2022 09:17:57 +0200 Subject: [PATCH 19/20] alphabetical order --- Docs/Actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/Actions.md b/Docs/Actions.md index e0637d744..4185f4a01 100644 --- a/Docs/Actions.md +++ b/Docs/Actions.md @@ -11,7 +11,7 @@ In addition to the below short explanations, check out the inline documentation - `publish-nuget`: Publishes the content of the current directory as a NuGet package. - `setup-azurite`: Sets up the [Azurite Azure Blob Storage Emulator](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite) via NPM. - `setup-dotnet`: Sets up the .NET SDK. +- `setup-edge-linux`: Sets up the Microsoft Edge on Linux. - `setup-sql-server`: Sets up SQL Server with Lombiq-recommended defaults. - `test-dotnet`: Runs .NET unit and UI tests (with the [Lombiq UI Testing Toolbox for Orchard Core](https://github.com/Lombiq/UI-Testing-Toolbox)), generates a test report, and uploads UI testing failure dumps to artifacts. - `verify-submodule-pull-request`: Assuming that the current repository is a submodule in another repository, this action verifies that a pull request with a matching issue code has been opened there as well. -- `setup-edge-linux`: Sets up the Microsoft Edge on Linux. From 9c579c58e6d3232eff36c2cce418cf928f6dda4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 30 Jun 2022 19:23:43 +0200 Subject: [PATCH 20/20] Removing temporary branch references --- .github/workflows/build-and-test-orchard-core.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 70e5e7628..a4299d549 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -121,11 +121,11 @@ jobs: # default on windows-latest, so here we install Edge on ubuntu-latest. It seems Linux support is planned here # (https://github.com/browser-actions/setup-edge), after this completes we can use it. - name: Set up Edge - uses: Lombiq/GitHub-Actions/.github/actions/setup-edge-linux@issue/OSOE-111 + uses: Lombiq/GitHub-Actions/.github/actions/setup-edge-linux@dev if: ${{ inputs.setup-edge-on-linux }} - name: Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-111 + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: build-directory: ${{ inputs.build-directory}} test-verbosity: ${{ inputs.build-verbosity}}