diff --git a/.github/actions/add-azure-application-insights-release-annotation/action.yml b/.github/actions/add-azure-application-insights-release-annotation/action.yml index 610844f25..c3717fee8 100644 --- a/.github/actions/add-azure-application-insights-release-annotation/action.yml +++ b/.github/actions/add-azure-application-insights-release-annotation/action.yml @@ -20,7 +20,7 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH - name: Add Azure Application Insights Release Annotation shell: pwsh diff --git a/.github/actions/auto-merge-pull-request/action.yml b/.github/actions/auto-merge-pull-request/action.yml index a0a32c0da..32df66213 100644 --- a/.github/actions/auto-merge-pull-request/action.yml +++ b/.github/actions/auto-merge-pull-request/action.yml @@ -17,7 +17,7 @@ runs: - name: Setup Scripts shell: pwsh run: | - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Check Mergeability id: check-mergeability diff --git a/.github/actions/auto-transition-jira-issue/action.yml b/.github/actions/auto-transition-jira-issue/action.yml index fbd44abab..c953a2470 100644 --- a/.github/actions/auto-transition-jira-issue/action.yml +++ b/.github/actions/auto-transition-jira-issue/action.yml @@ -10,8 +10,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Check if Should Done id: check-done diff --git a/.github/actions/build-dotnet/action.yml b/.github/actions/build-dotnet/action.yml index 64b50fccc..f0bba77b8 100644 --- a/.github/actions/build-dotnet/action.yml +++ b/.github/actions/build-dotnet/action.yml @@ -91,8 +91,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Setup & Detect Cache Configuration id: detect-cache-configuration diff --git a/.github/actions/cancel-workflow/action.yml b/.github/actions/cancel-workflow/action.yml index fb0a0c508..b44608e8d 100644 --- a/.github/actions/cancel-workflow/action.yml +++ b/.github/actions/cancel-workflow/action.yml @@ -15,7 +15,7 @@ runs: - name: Setup Scripts shell: pwsh run: | - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Cancel Workflow # Fork PRs won't have a token with write access to Actions, thus won't be able to cancel the workflow. diff --git a/.github/actions/check-current-workflow-is-latest/action.yml b/.github/actions/check-current-workflow-is-latest/action.yml index f171f06fe..0c19efdc0 100644 --- a/.github/actions/check-current-workflow-is-latest/action.yml +++ b/.github/actions/check-current-workflow-is-latest/action.yml @@ -20,7 +20,7 @@ runs: - name: Setup Scripts shell: pwsh run: | - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Check Current Workflow Equals Latest shell: pwsh diff --git a/.github/actions/check-merge-queue-adds/action.yml b/.github/actions/check-merge-queue-adds/action.yml index 64fd187a0..7a91ba5a2 100644 --- a/.github/actions/check-merge-queue-adds/action.yml +++ b/.github/actions/check-merge-queue-adds/action.yml @@ -15,8 +15,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Check Merge Queue Adds id: check-merge-queue-adds diff --git a/.github/actions/check-pull-request-labels/action.yml b/.github/actions/check-pull-request-labels/action.yml index d60099b8c..2d6fa4cc7 100644 --- a/.github/actions/check-pull-request-labels/action.yml +++ b/.github/actions/check-pull-request-labels/action.yml @@ -23,8 +23,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Check Labels id: check-labels diff --git a/.github/actions/check-pull-request-reviews/action.yml b/.github/actions/check-pull-request-reviews/action.yml index 2499bfe52..465139e3a 100644 --- a/.github/actions/check-pull-request-reviews/action.yml +++ b/.github/actions/check-pull-request-reviews/action.yml @@ -14,8 +14,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Check Reviews id: check-reviews diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml index 11415cfc0..5442f88f7 100644 --- a/.github/actions/checkout/action.yml +++ b/.github/actions/checkout/action.yml @@ -29,7 +29,7 @@ runs: - name: Setup Scripts shell: pwsh run: | - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Set Checkout Token uses: Lombiq/GitHub-Actions/.github/actions/set-checkout-token@dev diff --git a/.github/actions/create-jira-issues-for-community-activities/action.yml b/.github/actions/create-jira-issues-for-community-activities/action.yml index 8c65c229f..1dc38feab 100644 --- a/.github/actions/create-jira-issues-for-community-activities/action.yml +++ b/.github/actions/create-jira-issues-for-community-activities/action.yml @@ -21,8 +21,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH # Don't do anything for pull requests that are already related to an issue, i.e. their titles start with an issue # key. diff --git a/.github/actions/get-changed-files-from-git-diff/action.yml b/.github/actions/get-changed-files-from-git-diff/action.yml index 2f96be8dd..98a0944ae 100644 --- a/.github/actions/get-changed-files-from-git-diff/action.yml +++ b/.github/actions/get-changed-files-from-git-diff/action.yml @@ -28,7 +28,7 @@ runs: - name: Setup shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH - name: Git Diff id: git-diff diff --git a/.github/actions/get-changed-gha-items/action.yml b/.github/actions/get-changed-gha-items/action.yml index 2421b54d8..1f0abe923 100644 --- a/.github/actions/get-changed-gha-items/action.yml +++ b/.github/actions/get-changed-gha-items/action.yml @@ -19,7 +19,7 @@ runs: - name: Setup shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH - name: Get GHA Items id: get-gha-items diff --git a/.github/actions/install-dotnet-tool/action.yml b/.github/actions/install-dotnet-tool/action.yml index 4726f883b..89aba5e7a 100644 --- a/.github/actions/install-dotnet-tool/action.yml +++ b/.github/actions/install-dotnet-tool/action.yml @@ -15,7 +15,7 @@ runs: - name: Setup Scripts shell: pwsh run: | - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Install tool shell: pwsh run: | diff --git a/.github/actions/markdown-lint/action.yml b/.github/actions/markdown-lint/action.yml index ac5f315ba..36d1387a5 100644 --- a/.github/actions/markdown-lint/action.yml +++ b/.github/actions/markdown-lint/action.yml @@ -38,7 +38,7 @@ runs: - name: Setup Scripts shell: pwsh - run: (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + run: (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Copy files updated by markdown-lint automatic fixes if: inputs.fix == 'true' diff --git a/.github/actions/msbuild/action.yml b/.github/actions/msbuild/action.yml index d4ecbc030..d784f7bd6 100644 --- a/.github/actions/msbuild/action.yml +++ b/.github/actions/msbuild/action.yml @@ -45,8 +45,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Add MSBuild to PATH # v2.0.0 diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index 364008d89..b2a29914d 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -46,8 +46,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Setup NuGet Version id: setup diff --git a/.github/actions/set-checkout-token/action.yml b/.github/actions/set-checkout-token/action.yml index d39bb2205..caa3df842 100644 --- a/.github/actions/set-checkout-token/action.yml +++ b/.github/actions/set-checkout-token/action.yml @@ -20,7 +20,7 @@ runs: - name: Setup Scripts shell: pwsh run: | - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Set Checkout Token shell: pwsh diff --git a/.github/actions/set-environment-variables/action.yml b/.github/actions/set-environment-variables/action.yml new file mode 100644 index 000000000..ea6fd22b4 --- /dev/null +++ b/.github/actions/set-environment-variables/action.yml @@ -0,0 +1,25 @@ +name: Set Environment Variables +description: > + Set environment variables from a JSON string of key-value pairs, passed in via the ENVIRONMENT_VARIABLES_JSON + environment variable. Intentionally not documented in Actions.md since it's only meant for internal use. + +runs: + using: composite + steps: + - name: Setup Scripts + if: ${{ env.ENVIRONMENT_VARIABLES_JSON }} + shell: pwsh + run: | + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH + + - name: Set Environment Variables + if: ${{ env.ENVIRONMENT_VARIABLES_JSON }} + shell: pwsh + run: | + $envVars = ConvertFrom-Json $env:ENVIRONMENT_VARIABLES_JSON + foreach ($key in $envVars.PSObject.Properties.Name) + { + Write-Output "Setting environment variable $key." + Write-Output "::add-mask::$($envVars.$key)" + Set-GitHubEnv $key $envVars.$key + } diff --git a/.github/actions/set-gha-refs/action.yml b/.github/actions/set-gha-refs/action.yml index 97bb1e02b..1f62f1f6c 100644 --- a/.github/actions/set-gha-refs/action.yml +++ b/.github/actions/set-gha-refs/action.yml @@ -40,7 +40,7 @@ runs: - name: Setup shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH - name: Set References shell: pwsh diff --git a/.github/actions/setup-dotnet/action.yml b/.github/actions/setup-dotnet/action.yml index 2af11ca8a..742eed9a6 100644 --- a/.github/actions/setup-dotnet/action.yml +++ b/.github/actions/setup-dotnet/action.yml @@ -13,7 +13,7 @@ runs: - name: Setup Scripts shell: pwsh run: | - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Set Environment Variables shell: pwsh diff --git a/.github/actions/setup-sql-server/action.yml b/.github/actions/setup-sql-server/action.yml index e021ffe0c..f0215c82f 100644 --- a/.github/actions/setup-sql-server/action.yml +++ b/.github/actions/setup-sql-server/action.yml @@ -7,7 +7,7 @@ runs: - name: Setup shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH - name: Set up SQL Server shell: pwsh diff --git a/.github/actions/spelling/action.yml b/.github/actions/spelling/action.yml index d8c54fea0..23c6c4c06 100644 --- a/.github/actions/spelling/action.yml +++ b/.github/actions/spelling/action.yml @@ -65,8 +65,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH # If the configuration path doesn't exist in the workspace, then it means that the workspace repository doesn't have # its own spell-checking configuration. In that case we don't need to copy anything, because the configuration files diff --git a/.github/actions/spelling/dictionaries/Lombiq.common.txt b/.github/actions/spelling/dictionaries/Lombiq.common.txt index 26aa5c157..d7f889c6f 100644 --- a/.github/actions/spelling/dictionaries/Lombiq.common.txt +++ b/.github/actions/spelling/dictionaries/Lombiq.common.txt @@ -47,7 +47,9 @@ hastlayer hca HHmmss hotfixes +htmlvalidate idx +iframes iis img importmap diff --git a/.github/actions/spelling/dictionaries/Security.txt b/.github/actions/spelling/dictionaries/Security.txt index 2e15e8caa..459c4be14 100644 --- a/.github/actions/spelling/dictionaries/Security.txt +++ b/.github/actions/spelling/dictionaries/Security.txt @@ -1,5 +1,6 @@ amd clickjacking +CORS Entra nosniff openapi diff --git a/.github/actions/test-dotnet/Invoke-SolutionTests.ps1 b/.github/actions/test-dotnet/Invoke-SolutionOrProjectTests.ps1 similarity index 79% rename from .github/actions/test-dotnet/Invoke-SolutionTests.ps1 rename to .github/actions/test-dotnet/Invoke-SolutionOrProjectTests.ps1 index 6119b89d3..aa9e783ed 100644 --- a/.github/actions/test-dotnet/Invoke-SolutionTests.ps1 +++ b/.github/actions/test-dotnet/Invoke-SolutionOrProjectTests.ps1 @@ -1,5 +1,5 @@ param ( - [string] $Solution, + [string] $SolutionOrProject, [string] $Verbosity, [string] $Filter, [string] $Configuration, @@ -44,40 +44,58 @@ $connectionString = @( $Env:Lombiq_Tests_UI__SqlServerDatabaseConfiguration__ConnectionStringTemplate = $connectionString $Env:Lombiq_Tests_UI__BrowserConfiguration__Headless = 'true' -$solutionName = [System.IO.Path]::GetFileNameWithoutExtension($Solution) -$solutionDirectory = [System.IO.Path]::GetDirectoryName($Solution) - -Write-Output "Running tests for the $Solution solution." - -Write-Output 'Gathering test projects.' - -$tests = dotnet sln $Solution list | - Select-Object -Skip 2 | - Select-String '\.Tests\.' | - Select-String -NotMatch 'Lombiq.Tests.UI.csproj' | - Select-String -NotMatch 'Lombiq.Tests.csproj' | - Where-Object { - # While the test projects are run individually, passing in the solution name and solution dir via the - # conventional MSBuild properties allows build customization. - $switches = @( - "--configuration:$Configuration" - '--list-tests' - "--verbosity:$Verbosity" - "-p:SolutionName=""$solutionName""" - "-p:SolutionDir=""$solutionDirectory""" - ) - - # Without Out-String, Contains() below won't work for some reason. - $output = dotnet test @switches $PSItem 2>&1 | Out-String -Width 9999 - - if ($LASTEXITCODE -ne 0) - { - Write-Error "::error::dotnet test failed for the project $PSItem with the following output:`n$output" - exit 1 +if ($SolutionOrProject -like '*.sln') +{ + $solutionName = [System.IO.Path]::GetFileNameWithoutExtension($SolutionOrProject) + $solutionDirectory = [System.IO.Path]::GetDirectoryName($SolutionOrProject) + + Write-Output "Running tests for the $SolutionOrProject solution." + + Write-Output 'Gathering test projects.' + + $tests = dotnet sln $SolutionOrProject list | + Select-Object -Skip 2 | + Select-String '\.Tests\.' | + Select-String -NotMatch 'Lombiq.Tests.UI.csproj' | + Select-String -NotMatch 'Lombiq.Tests.csproj' | + ForEach-Object { + $absolutePath = Resolve-Path -Path (Join-Path -Path $solutionDirectory -ChildPath $PSItem) + + # While the test projects are run individually, passing in the solution name and solution dir via the + # conventional MSBuild properties allows build customization. + $switches = @( + "--configuration:$Configuration" + '--list-tests' + "--verbosity:$Verbosity" + "-p:SolutionName=""$solutionName""" + "-p:SolutionDir=""$solutionDirectory""" + ) + + # Without Out-String, Contains() below won't work for some reason. + $output = dotnet test @switches $absolutePath 2>&1 | Out-String -Width 9999 + + if ($LASTEXITCODE -ne 0) + { + Write-Error "::error::dotnet test failed for the project $absolutePath with the following output:`n$output" + exit 1 + } + + if (-not [string]::IsNullOrEmpty($output) -and $output.Contains('The following Tests are available')) + { + $absolutePath + } } - - -not [string]::IsNullOrEmpty($output) -and $output.Contains('The following Tests are available') - } +} +elseif ($SolutionOrProject -like '*.csproj') +{ + Write-Output "Running tests for the $SolutionOrProject project." + $tests = @($SolutionOrProject) +} +else +{ + Write-Error "The $SolutionOrProject is not a solution or project file." + exit 1 +} Set-GitHubOutput 'test-count' $tests.Length Set-GitHubOutput 'dotnet-test-hang-dump' 0 diff --git a/.github/actions/test-dotnet/Test-SolutionTests.ps1 b/.github/actions/test-dotnet/Test-SolutionTests.ps1 index 06f2f515a..8d7fe19ae 100644 --- a/.github/actions/test-dotnet/Test-SolutionTests.ps1 +++ b/.github/actions/test-dotnet/Test-SolutionTests.ps1 @@ -1,10 +1,10 @@ <# .Synopsis - Local testing script to run the Invoke-SolutionTests script. This needs to be invoked from the solution folder. + Local testing script to run the Invoke-SolutionOrProjectTests script. This needs to be invoked from the solution folder. #> $switches = @{ - Solution = '.\Lombiq.OSOCE.sln' + SolutionOrProject = '.\Lombiq.OSOCE.sln' Verbosity = 'quiet' Filter = '' Configuration = 'Debug' @@ -12,4 +12,4 @@ $switches = @{ TestProcessTimeout = '600000' } -.\tools\Lombiq.GitHub.Actions\.github\actions\test-dotnet\Invoke-SolutionTests.ps1 @switches +.\tools\Lombiq.GitHub.Actions\.github\actions\test-dotnet\Invoke-SolutionOrProjectTests.ps1 @switches diff --git a/.github/actions/test-dotnet/action.yml b/.github/actions/test-dotnet/action.yml index 925180881..2041157bd 100644 --- a/.github/actions/test-dotnet/action.yml +++ b/.github/actions/test-dotnet/action.yml @@ -72,8 +72,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Setup & Set Test Parallelization id: setup @@ -103,7 +103,7 @@ runs: working-directory: ${{ inputs.build-directory }} run: | $switches = @{ - Solution = Get-SolutionOrProjectPath ${{ inputs.solution-path }} + SolutionOrProject = Get-SolutionOrProjectPath ${{ inputs.solution-path }} Verbosity = "${{ inputs.test-verbosity }}" Filter = "${{ inputs.test-filter }}" Configuration = "${{ inputs.test-configuration }}" @@ -112,7 +112,7 @@ runs: EnableDiagnosticMode = $${{ inputs.enable-diagnostic-mode }} } - Invoke-SolutionTests @switches + Invoke-SolutionOrProjectTests @switches # Note that uploading the failure dumps would fail under Windows if the path were too long, regardless of # LongPathsEnabled, see: https://github.com/actions/upload-artifact/issues/309. To get around that we merge all diff --git a/.github/actions/update-github-issue-and-pull-request/action.yml b/.github/actions/update-github-issue-and-pull-request/action.yml index 8df22f4ff..8dac50d76 100644 --- a/.github/actions/update-github-issue-and-pull-request/action.yml +++ b/.github/actions/update-github-issue-and-pull-request/action.yml @@ -9,8 +9,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Add Jira Issue Code to Pull Request shell: pwsh diff --git a/.github/actions/verify-dotnet-consolidation/action.yml b/.github/actions/verify-dotnet-consolidation/action.yml index ced0bc81b..65f8a788b 100644 --- a/.github/actions/verify-dotnet-consolidation/action.yml +++ b/.github/actions/verify-dotnet-consolidation/action.yml @@ -35,8 +35,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH - name: Install dotnet-consolidate uses: Lombiq/GitHub-Actions/.github/actions/install-dotnet-tool@dev diff --git a/.github/actions/verify-gha-refs/action.yml b/.github/actions/verify-gha-refs/action.yml index 280eee87a..5648ccb40 100644 --- a/.github/actions/verify-gha-refs/action.yml +++ b/.github/actions/verify-gha-refs/action.yml @@ -32,7 +32,7 @@ runs: - name: Setup shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH - name: Check References id: check-references diff --git a/.github/actions/verify-submodule-pull-request/action.yml b/.github/actions/verify-submodule-pull-request/action.yml index 67ab1c683..f6c37ae76 100644 --- a/.github/actions/verify-submodule-pull-request/action.yml +++ b/.github/actions/verify-submodule-pull-request/action.yml @@ -18,8 +18,8 @@ runs: - name: Setup Scripts shell: pwsh run: | - "${{ github.action_path }}" >> $Env:GITHUB_PATH - (Resolve-Path "${{ github.action_path }}/../../../Scripts").Path >> $Env:GITHUB_PATH + '${{ github.action_path }}' >> $Env:GITHUB_PATH + (Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH New-Item -ItemType File -Force $Profile | Out-Null Get-Content -Raw ${{ github.action_path }}/functions.ps1 >> $Profile diff --git a/.github/workflows/build-and-test-dotnet.yml b/.github/workflows/build-and-test-dotnet.yml index afd688e1b..17d15e593 100644 --- a/.github/workflows/build-and-test-dotnet.yml +++ b/.github/workflows/build-and-test-dotnet.yml @@ -8,6 +8,11 @@ on: description: > The GitHub token to authenticate checkout. Pass in a GitHub personal access token if authenticated submodules are used. + ENVIRONMENT_VARIABLES_JSON: + required: false + description: > + A JSON string containing key-value pairs of environment variables to be set. You can use this to pass in + arbitrary environment variables that can be used to e.g. customize the build or test execution. inputs: cancel-in-progress-for-this-pr: @@ -36,6 +41,18 @@ on: description: > Stringified JSON array with the name of the type of machine(s) to run the workflow under, e.g. '["ubuntu-22.04"]' or '["ubuntu-22.04", "windows-2022"]'. + repository: + description: > + Repository name with owner to git checkout, if not the current repository. E.g. "Lombiq/GitHub-Actions". + Defaults to the current repository. + type: string + default: ${{ github.repository }} + repository-ref: + description: > + The branch, tag or SHA to checkout. When checking out the repository that triggered the workflow, this + defaults to the reference or SHA for that event. Otherwise, uses the default branch. + type: string + default: '' dotnet-version: type: string default: 8.0.301 @@ -211,9 +228,16 @@ jobs: with: github_token: ${{ secrets.CHECKOUT_TOKEN }} + - name: Set Environment Variables + uses: Lombiq/GitHub-Actions/.github/actions/set-environment-variables@dev + env: + ENVIRONMENT_VARIABLES_JSON: ${{ secrets.ENVIRONMENT_VARIABLES_JSON }} + - name: Checkout uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.repository-ref }} token: ${{ secrets.CHECKOUT_TOKEN }} - name: Set up .NET diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index ba38b10f3..c20385c74 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -8,6 +8,11 @@ on: description: > The GitHub token to authenticate checkout. Pass in a GitHub personal access token if authenticated submodules are used. + ENVIRONMENT_VARIABLES_JSON: + required: false + description: > + A JSON string containing key-value pairs of environment variables to be set. You can use this to pass in + arbitrary environment variables that can be used to e.g. customize the build or test execution. inputs: cancel-in-progress-for-this-pr: @@ -36,6 +41,18 @@ on: description: > Stringified JSON array with the name of the type of machine(s) to run the workflow under, e.g. '["ubuntu-22.04"]' or '["ubuntu-22.04", "windows-2022"]'. + repository: + description: > + Repository name with owner to git checkout, if not the current repository. E.g. "Lombiq/GitHub-Actions". + Defaults to the current repository. + type: string + default: ${{ github.repository }} + repository-ref: + description: > + The branch, tag or SHA to checkout. When checking out the repository that triggered the workflow, this + defaults to the reference or SHA for that event. Otherwise, uses the default branch. + type: string + default: '' dotnet-version: type: string default: 8.0.301 @@ -233,6 +250,11 @@ jobs: with: github_token: ${{ secrets.CHECKOUT_TOKEN }} + - name: Set Environment Variables + uses: Lombiq/GitHub-Actions/.github/actions/set-environment-variables@dev + env: + ENVIRONMENT_VARIABLES_JSON: ${{ secrets.ENVIRONMENT_VARIABLES_JSON }} + - name: Display ui-test-parallelism Obsolete Warning if: ${{ inputs.ui-test-parallelism != '-1' }} shell: pwsh @@ -247,6 +269,8 @@ jobs: - name: Checkout uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.repository-ref }} token: ${{ secrets.CHECKOUT_TOKEN }} - name: Set up .NET diff --git a/.github/workflows/msbuild-and-test.yml b/.github/workflows/msbuild-and-test.yml index 01c2fdabb..5ed7e7bf7 100644 --- a/.github/workflows/msbuild-and-test.yml +++ b/.github/workflows/msbuild-and-test.yml @@ -26,6 +26,11 @@ on: description: > The GitHub token to authenticate checkout. Pass in a GitHub personal access token if authenticated submodules are used. + ENVIRONMENT_VARIABLES_JSON: + required: false + description: > + A JSON string containing key-value pairs of environment variables to be set. You can use this to pass in + arbitrary environment variables that can be used to e.g. customize the build or test execution. inputs: cancel-in-progress-for-this-pr: @@ -51,6 +56,18 @@ on: default: windows-2022 description: > The machine type to run the workflow under, e.g. "windows-2022". Needs to be Windows. + repository: + description: > + Repository name with owner to git checkout, if not the current repository. E.g. "Lombiq/GitHub-Actions". + Defaults to the current repository. + type: string + default: ${{ github.repository }} + repository-ref: + description: > + The branch, tag or SHA to checkout. When checking out the repository that triggered the workflow, this + defaults to the reference or SHA for that event. Otherwise, uses the default branch. + type: string + default: '' build-directory: type: string default: . @@ -115,9 +132,16 @@ jobs: with: github_token: ${{ secrets.CHECKOUT_TOKEN }} + - name: Set Environment Variables + uses: Lombiq/GitHub-Actions/.github/actions/set-environment-variables@dev + env: + ENVIRONMENT_VARIABLES_JSON: ${{ secrets.ENVIRONMENT_VARIABLES_JSON }} + - name: Checkout uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.repository-ref }} token: ${{ secrets.CHECKOUT_TOKEN }} - name: Enable Node corepack diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 74e5cd177..643ca94b5 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -11,6 +11,13 @@ on: # We can't access org secrets here so they need to be passed in. API_KEY: required: true + description: > + The API key to authenticate with the NuGet server when pushing packages. + ENVIRONMENT_VARIABLES_JSON: + required: false + description: > + A JSON string containing key-value pairs of environment variables to be set. You can use this to pass in + arbitrary environment variables that can be used to e.g. customize the build or test execution. inputs: cancel-workflow-on-failure: @@ -68,6 +75,11 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: ${{ inputs.timeout-minutes }} steps: + - name: Set Environment Variables + uses: Lombiq/GitHub-Actions/.github/actions/set-environment-variables@dev + env: + ENVIRONMENT_VARIABLES_JSON: ${{ secrets.ENVIRONMENT_VARIABLES_JSON }} + - name: Checkout uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: