Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LMBQ-178: Fixing test-dotnet path resolution, adding the ability to pass environment variables and repository details to build workflows #381

Merged
merged 31 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2a86310
Pointing GHA to issue branch
Piedone Aug 9, 2024
df34f08
Resolving test project path form the solution path
Piedone Aug 9, 2024
2e023f8
Rename
Piedone Aug 9, 2024
b307911
Fixing path resolution for the actual test execution too
Piedone Aug 9, 2024
32d5ce7
Allowing running tests from individual projects too
Piedone Aug 9, 2024
23625e3
PS syntax
Piedone Aug 10, 2024
453cc15
Pointing GHA to issue branch
Piedone Aug 10, 2024
0cec687
Fixing check-spelling repo reference
Piedone Aug 10, 2024
97c88e2
And again
Piedone Aug 10, 2024
2ce5135
Adding ability to pass environment variables to build-build-and-test-…
Piedone Aug 10, 2024
d487481
Syntax
Piedone Aug 10, 2024
d796d37
Leftover rename
Piedone Aug 10, 2024
5d37bcc
GH workflow syntax
Piedone Aug 10, 2024
4c22595
Linting error
Piedone Aug 10, 2024
499ed47
Debug output
Piedone Aug 10, 2024
47653ae
Syntax
Piedone Aug 10, 2024
1c8f44e
Remove debug output
Piedone Aug 10, 2024
c4155ff
Revert "Remove debug output"
Piedone Aug 10, 2024
cdc8e52
Reapply "Remove debug output"
Piedone Aug 11, 2024
d33a32e
Adding ENVIRONMENT_VARIABLES_JSON to the other build workflows too
Piedone Aug 11, 2024
5ae1bde
Masking env vars passed to build workflows
Piedone Aug 11, 2024
31fb0d7
Adding "iframes" to spelling
Piedone Aug 11, 2024
1382e54
More common words
Piedone Aug 11, 2024
7a36718
Re-adding mistakenly removed code
Piedone Aug 11, 2024
67344d0
Informational output
Piedone Aug 12, 2024
a6fbc2e
Ability to pass the repository explicitly to build-and-test-orchard-core
Piedone Aug 12, 2024
65f9bb0
Ability to pass a ref to build-and-test-orchard-core too
Piedone Aug 12, 2024
075fb6e
Ability to pass repository details in the other build workflows too
Piedone Aug 12, 2024
ae3b01e
Renaming Invoke-SolutionTests to reflect that it also supports projects
Piedone Aug 14, 2024
eb1ed64
Adding newline at the end of the file
DemeSzabolcs Aug 15, 2024
54aabeb
Updating action and workflow references to dev
DemeSzabolcs Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
- name: Setup Scripts
shell: pwsh
run: |
"${{ github.action_path }}" >> $Env:GITHUB_PATH
'${{ github.action_path }}' >> $Env:GITHUB_PATH
DemeSzabolcs marked this conversation as resolved.
Show resolved Hide resolved

- name: Add Azure Application Insights Release Annotation
shell: pwsh
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/auto-merge-pull-request/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ 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
# Fork PR runs won't have permissions to remove labels, nor do we want to allow auto-merging them.
if: github.event.pull_request.head.repo.fork == false
uses: Lombiq/GitHub-Actions/.github/actions/check-pull-request-labels@dev
uses: Lombiq/GitHub-Actions/.github/actions/check-pull-request-labels@issue/LMBQ-178
with:
label1: merge-if-checks-succeed
label2: merge-and-resolve-jira-issue-if-checks-succeed
Expand All @@ -37,7 +37,7 @@ runs:

- name: Remove Label
if: steps.check-mergeability.outputs.contains-label == 'true'
uses: Lombiq/GitHub-Actions/.github/actions/add-remove-label@dev
uses: Lombiq/GitHub-Actions/.github/actions/add-remove-label@issue/LMBQ-178
with:
token: ${{ env.GITHUB_TOKEN }}
labels: merge-if-checks-succeed
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/auto-transition-jira-issue/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ 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
uses: Lombiq/GitHub-Actions/.github/actions/check-pull-request-labels@dev
uses: Lombiq/GitHub-Actions/.github/actions/check-pull-request-labels@issue/LMBQ-178
with:
label1: done-jira-issue-if-checks-succeed
label2: dummy

- name: Check if Should Resolve
id: check-resolve
if: steps.check-done.outputs.contains-label == 'false'
uses: Lombiq/GitHub-Actions/.github/actions/check-pull-request-labels@dev
uses: Lombiq/GitHub-Actions/.github/actions/check-pull-request-labels@issue/LMBQ-178
with:
label1: resolve-jira-issue-if-checks-succeed
label2: merge-and-resolve-jira-issue-if-checks-succeed
Expand All @@ -41,7 +41,7 @@ runs:
Set-JiraIssueStatus @parameters

- name: Remove Label
uses: Lombiq/GitHub-Actions/.github/actions/add-remove-label@dev
uses: Lombiq/GitHub-Actions/.github/actions/add-remove-label@issue/LMBQ-178
with:
token: ${{ env.GITHUB_TOKEN }}
labels: merge-and-resolve-jira-issue-if-checks-succeed, resolve-jira-issue-if-checks-succeed, done-jira-issue-if-checks-succeed
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/build-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -211,7 +211,7 @@ runs:
Write-Output ("Solution or project build took {0:0.###} seconds." -f ($endTime - $startTime).TotalSeconds)

- name: Upload MSBuild Binary Log
uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@dev
uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@issue/LMBQ-178
if: (success() || failure()) && inputs.create-binary-log == 'true'
with:
name: build-binary-log-${{ steps.build.outputs.artifact-name-suffix }}.binlog
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/cancel-workflow/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/check-merge-queue-adds/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/check-pull-request-labels/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/check-pull-request-reviews/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/checkout/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ 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
uses: Lombiq/GitHub-Actions/.github/actions/set-checkout-token@issue/LMBQ-178
with:
checkout-token: ${{ inputs.token }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/get-changed-files-from-git-diff/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/get-changed-gha-items/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/install-dotnet-tool/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/markdown-lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -57,7 +57,7 @@ runs:
Set-GitHubOutput 'artifact-path' $artifactFolder

- name: Upload files fixed by markdown-lint
uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@dev
uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@issue/LMBQ-178
if: inputs.fix == 'true' && steps.markdown-lint-fix-files.outputs.has-fixes == 'true'
with:
name: markdown-lint-fixed-files
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/msbuild/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/precompile-orchard1-app/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ runs:
if: inputs.repository != ''
# Using the official checkout action directly, because our wrapper action doesn't have most of the parameters we
# need here. We only need those parameters for this action though.
uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev
uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/LMBQ-178
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.checkout-ref }}
token: ${{ inputs.token }}
path: ${{ inputs.checkout-path }}

- name: Enable Node corepack
uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev
uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@issue/LMBQ-178

# Calling nuget restore separately on the actual solution, because we're passing Orchard.proj to the msbuild action
# instead to be able to call the Precompiled target on it.
Expand All @@ -72,7 +72,7 @@ runs:
run: nuget restore ${{ inputs.checkout-path }}/${{ inputs.solution-path }}

- name: Publish Precompiled app
uses: Lombiq/GitHub-Actions/.github/actions/msbuild@dev
uses: Lombiq/GitHub-Actions/.github/actions/msbuild@issue/LMBQ-178
with:
directory: ${{ inputs.checkout-path }}
verbosity: ${{ inputs.verbosity }}
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/publish-nuget/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -133,15 +133,15 @@ runs:
run: Update-ManifestVersion './' '${{ steps.setup.outputs.publish-version }}'

- name: Enable Node corepack
uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev
uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@issue/LMBQ-178

- name: Generate nuspec file if needed
if: hashFiles('ConvertTo-Nuspec.ps1')
shell: pwsh
run: ./ConvertTo-Nuspec.ps1 '${{ steps.setup.outputs.publish-version }}'

- name: Build
uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev
uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/LMBQ-178
# Notes on the configuration:
# * -p:NuGetBuild=true is our property to load Lombiq dependencies from NuGet by switching project references
# to package references.
Expand Down Expand Up @@ -226,14 +226,14 @@ runs:
run: dotnet nuget push artifacts/*.nupkg --api-key $Env:API_KEY --source '${{ steps.setup.outputs.source-url }}' --skip-duplicate

- name: Publish Artifacts
uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@dev
uses: Lombiq/GitHub-Actions/.github/actions/upload-artifact@issue/LMBQ-178
with:
name: NuGet-Package
path: artifacts
retention-days: ${{ inputs.nuget-artifact-retention-days }}

- name: Create Release
uses: Lombiq/GitHub-Actions/.github/actions/release-action@dev
uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/LMBQ-178
# This is to prevent creating releases when pushing tags for issue-specific pre-releases like
# v4.3.1-alpha.osoe-86.
if: "!contains(steps.setup.outputs.publish-version, '-')"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/set-checkout-token/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/set-environment-variables/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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)
{
Set-GitHubEnv $key $envVars.$key
}
2 changes: 1 addition & 1 deletion .github/actions/set-gha-refs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-sql-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/spelling/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ inputs:
Repository with default configuration to use when the workspace repository doesn't have its own configuration. The
default from Check Spelling is ''.
required: false
default: Lombiq/GitHub-Actions@dev
default: Lombiq/GitHub-Actions@issue/LMBQ-178
post-comment:
description: Flag for if check-spelling should post comment, the default is 1.
required: false
Expand All @@ -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
Expand Down
Loading
Loading