-
Notifications
You must be signed in to change notification settings - Fork 188
Workspace Compilation Follow-up - Add support for BCPT and Upgrade Tests #2186
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
Open
aholstrup1
wants to merge
7
commits into
main
Choose a base branch
from
aholstrup/workspace_compilation_part2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
84e3705
Add support for BCPT and previous apps
aholstrup1 9384dd7
update docs
aholstrup1 988ec42
Review findings
aholstrup1 1a0827b
Review
aholstrup1 1a8e85f
Update previousApps
aholstrup1 6316eb8
Suggestions
aholstrup1 6608363
Suggestions
aholstrup1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Actions/DownloadPreviousRelease/DownloadPreviousRelease.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| Param( | ||
| [Parameter(HelpMessage = "The GitHub token running the action", Mandatory = $false)] | ||
| [string] $token, | ||
| [Parameter(HelpMessage = "Project folder", Mandatory = $false)] | ||
| [string] $project = "" | ||
| ) | ||
|
|
||
| . (Join-Path -Path $PSScriptRoot -ChildPath "..\AL-Go-Helper.ps1" -Resolve) | ||
|
|
||
| $baseFolder = (Get-BasePath) | ||
| $projectFolder = Join-Path $baseFolder $project | ||
| $previousAppsPath = Join-Path $projectFolder ".previousRelease" | ||
| New-Item $previousAppsPath -ItemType Directory -Force | Out-Null | ||
|
|
||
| OutputGroupStart -Message "Locating previous release" | ||
| try { | ||
| $branchForRelease = if ($ENV:GITHUB_BASE_REF) { $ENV:GITHUB_BASE_REF } else { $ENV:GITHUB_REF_NAME } | ||
| $latestRelease = GetLatestRelease -token $token -api_url $ENV:GITHUB_API_URL -repository $ENV:GITHUB_REPOSITORY -ref $branchForRelease | ||
| if ($latestRelease) { | ||
| Write-Host "Using $($latestRelease.name) (tag $($latestRelease.tag_name)) as previous release" | ||
| DownloadRelease -token $token -projects $project -api_url $ENV:GITHUB_API_URL -repository $ENV:GITHUB_REPOSITORY -release $latestRelease -path $previousAppsPath -mask "Apps" -unpack | ||
| $previousApps = @(Get-ChildItem -Path $previousAppsPath -Recurse -Filter "*.app" | ForEach-Object { $_.FullName }) | ||
| Write-Host "Downloaded $($previousApps.Count) previous release app(s)" | ||
| } | ||
| else { | ||
| OutputWarning -message "No previous release found" | ||
| } | ||
aholstrup1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| catch { | ||
| OutputError -message "Error trying to locate previous release. Error was $($_.Exception.Message)" | ||
| exit | ||
| } | ||
| finally { | ||
| OutputGroupEnd | ||
| } | ||
|
|
||
| # Output variable with path to previous apps for use in subsequent steps | ||
| Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "PreviousAppsPath=$previousAppsPath" | ||
aholstrup1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Download Previous Release | ||
|
|
||
| Downloads the latest release apps for use as a baseline in AppSourceCop validation and upgrade testing. | ||
|
|
||
| ## INPUT | ||
|
|
||
| ### ENV variables | ||
|
|
||
| | Name | Description | | ||
| | :-- | :-- | | ||
| | Settings | env.Settings must be set by a prior call to the ReadSettings Action | | ||
|
|
||
| ### Parameters | ||
|
|
||
| | Name | Required | Description | Default value | | ||
| | :-- | :-: | :-- | :-- | | ||
| | shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell | | ||
| | project | | The AL-Go project for which to download previous release apps | '.' | | ||
|
|
||
| ## OUTPUT | ||
|
|
||
| ### OUTPUT variables | ||
|
|
||
| | Name | Description | | ||
| | :-- | :-- | | ||
| | PreviousAppsPath | Path to the folder containing the downloaded previous release apps. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Download Previous Release | ||
| author: Microsoft Corporation | ||
| inputs: | ||
| shell: | ||
| description: Shell in which you want to run the action (powershell or pwsh) | ||
| required: false | ||
| default: powershell | ||
| token: | ||
| description: The GitHub token running the action | ||
| required: false | ||
| default: ${{ github.token }} | ||
| project: | ||
| description: Project folder | ||
| required: false | ||
| default: '.' | ||
| outputs: | ||
| PreviousAppsPath: | ||
| description: Path to the folder containing the downloaded previous release apps. | ||
| value: ${{ steps.DownloadPreviousRelease.outputs.PreviousAppsPath }} | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: run | ||
| shell: ${{ inputs.shell }} | ||
| id: DownloadPreviousRelease | ||
| env: | ||
| _token: ${{ inputs.token }} | ||
| _project: ${{ inputs.project }} | ||
| run: | | ||
| ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "DownloadPreviousRelease" -Action { | ||
| ${{ github.action_path }}/DownloadPreviousRelease.ps1 -token $ENV:_token -project $ENV:_project | ||
| } | ||
| branding: | ||
| icon: terminal | ||
| color: blue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.