зеркало из https://github.com/microsoft/AL-Go.git
Allow GitHubRunner as a project setting (#1177)
Allow GitHubRunner as a project setting. This would enable us to compile apps on linux-based GitHub runners while running the tests on either windows GitHub runners or self-hosted runners.
This commit is contained in:
Родитель
564c339085
Коммит
a2a51be438
|
@ -768,6 +768,11 @@ function ReadSettings {
|
|||
if ($settings.shell -ne "powershell" -and $settings.shell -ne "pwsh") {
|
||||
throw "Invalid value for setting: shell: $($settings.githubRunnerShell)"
|
||||
}
|
||||
if (($settings.githubRunner -like "ubuntu-*") -and ($settings.githubRunnerShell -eq "powershell")) {
|
||||
Write-Host "Switching shell to pwsh for ubuntu"
|
||||
$settings.githubRunnerShell = "pwsh"
|
||||
}
|
||||
|
||||
if($settings.projectName -eq '') {
|
||||
$settings.projectName = $project # Default to project path as project name
|
||||
}
|
||||
|
|
|
@ -65,8 +65,7 @@ function Test-SettingsJson {
|
|||
Test-Property -settingsDescription $settingsDescription -json $json -key 'templateUrl' -should
|
||||
}
|
||||
if ($type -eq 'Project') {
|
||||
# GitHubRunner should not be in a project settings file (only read from repo or workflow settings)
|
||||
Test-Property -settingsDescription $settingsDescription -json $json -key 'githubRunner' -shouldnot
|
||||
# Test for things that should / should not exist in a project settings file
|
||||
Test-Property -settingsDescription $settingsDescription -json $json -key 'bcContainerHelperVersion' -shouldnot
|
||||
}
|
||||
if ($type -eq 'Workflow') {
|
||||
|
|
|
@ -156,6 +156,8 @@ function CreateBuildDimensions {
|
|||
|
||||
foreach($project in $projects) {
|
||||
$projectSettings = ReadSettings -project $project -baseFolder $baseFolder
|
||||
$gitHubRunner = $projectSettings.githubRunner.Split(',').Trim() | ConvertTo-Json -compress
|
||||
$githubRunnerShell = $projectSettings.githubRunnerShell
|
||||
$buildModes = @($projectSettings.buildModes)
|
||||
|
||||
if(!$buildModes) {
|
||||
|
@ -168,6 +170,8 @@ function CreateBuildDimensions {
|
|||
project = $project
|
||||
projectName = $projectSettings.projectName
|
||||
buildMode = $buildMode
|
||||
gitHubRunner = $gitHubRunner
|
||||
githubRunnerShell = $githubRunnerShell
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
- Issue 1184 Publish to Environment fails on 'Permission Denied'
|
||||
|
||||
### Allow GitHubRunner and GitHubRunnerShell as project settings
|
||||
|
||||
Previously, AL-Go required the GitHubRunner and GitHubRunnerShell settings to be set on repository level. This has now been changed such that they can be set on project level.
|
||||
|
||||
## v5.3
|
||||
|
||||
### Issues
|
||||
|
|
|
@ -152,8 +152,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
buildMode: ${{ matrix.buildMode }}
|
||||
|
|
|
@ -22,8 +22,6 @@ jobs:
|
|||
needs: [ ]
|
||||
runs-on: [ windows-latest ]
|
||||
outputs:
|
||||
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
|
||||
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
|
||||
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
|
||||
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
|
||||
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
|
||||
|
@ -75,8 +73,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
buildMode: ${{ matrix.buildMode }}
|
||||
|
|
|
@ -22,8 +22,6 @@ jobs:
|
|||
needs: [ ]
|
||||
runs-on: [ windows-latest ]
|
||||
outputs:
|
||||
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
|
||||
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
|
||||
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
|
||||
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
|
||||
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
|
||||
|
@ -75,8 +73,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
buildMode: ${{ matrix.buildMode }}
|
||||
|
|
|
@ -22,8 +22,6 @@ jobs:
|
|||
needs: [ ]
|
||||
runs-on: [ windows-latest ]
|
||||
outputs:
|
||||
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
|
||||
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
|
||||
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
|
||||
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
|
||||
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
|
||||
|
@ -75,8 +73,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
buildMode: ${{ matrix.buildMode }}
|
||||
|
|
|
@ -35,8 +35,6 @@ jobs:
|
|||
if: (!failure() && !cancelled())
|
||||
runs-on: [ windows-latest ]
|
||||
outputs:
|
||||
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
|
||||
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
|
||||
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
|
||||
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
|
||||
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
|
||||
|
@ -90,8 +88,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
|
|
|
@ -152,7 +152,7 @@ jobs:
|
|||
id: sign
|
||||
uses: microsoft/AL-Go-Actions/Sign@main
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
shell: ${{ inputs.shell }}
|
||||
azureCredentialsJson: '${{ fromJson(steps.ReadSecrets.outputs.Secrets).AZURE_CREDENTIALS }}'
|
||||
pathToFiles: '${{ inputs.project }}/.buildartifacts/Apps/*.app'
|
||||
|
||||
|
|
|
@ -152,8 +152,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
buildMode: ${{ matrix.buildMode }}
|
||||
|
|
|
@ -22,8 +22,6 @@ jobs:
|
|||
needs: [ ]
|
||||
runs-on: [ windows-latest ]
|
||||
outputs:
|
||||
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
|
||||
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
|
||||
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
|
||||
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
|
||||
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
|
||||
|
@ -75,8 +73,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
buildMode: ${{ matrix.buildMode }}
|
||||
|
|
|
@ -22,8 +22,6 @@ jobs:
|
|||
needs: [ ]
|
||||
runs-on: [ windows-latest ]
|
||||
outputs:
|
||||
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
|
||||
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
|
||||
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
|
||||
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
|
||||
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
|
||||
|
@ -75,8 +73,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
buildMode: ${{ matrix.buildMode }}
|
||||
|
|
|
@ -22,8 +22,6 @@ jobs:
|
|||
needs: [ ]
|
||||
runs-on: [ windows-latest ]
|
||||
outputs:
|
||||
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
|
||||
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
|
||||
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
|
||||
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
|
||||
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
|
||||
|
@ -75,8 +73,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
buildMode: ${{ matrix.buildMode }}
|
||||
|
|
|
@ -35,8 +35,6 @@ jobs:
|
|||
if: (!failure() && !cancelled())
|
||||
runs-on: [ windows-latest ]
|
||||
outputs:
|
||||
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
|
||||
githubRunnerShell: ${{ steps.ReadSettings.outputs.GitHubRunnerShell }}
|
||||
projects: ${{ steps.determineProjectsToBuild.outputs.ProjectsJson }}
|
||||
projectDependenciesJson: ${{ steps.determineProjectsToBuild.outputs.ProjectDependenciesJson }}
|
||||
buildOrderJson: ${{ steps.determineProjectsToBuild.outputs.BuildOrderJson }}
|
||||
|
@ -90,8 +88,8 @@ jobs:
|
|||
uses: ./.github/workflows/_BuildALGoProject.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
runsOn: ${{ needs.Initialization.outputs.githubRunner }}
|
||||
shell: ${{ matrix.githubRunnerShell }}
|
||||
runsOn: ${{ matrix.githubRunner }}
|
||||
checkoutRef: ${{ github.event_name == 'pull_request' && github.sha || format('refs/pull/{0}/merge', github.event.pull_request.number) }}
|
||||
project: ${{ matrix.project }}
|
||||
projectName: ${{ matrix.projectName }}
|
||||
|
|
|
@ -152,7 +152,7 @@ jobs:
|
|||
id: sign
|
||||
uses: microsoft/AL-Go-Actions/Sign@main
|
||||
with:
|
||||
shell: ${{ needs.Initialization.outputs.githubRunnerShell }}
|
||||
shell: ${{ inputs.shell }}
|
||||
azureCredentialsJson: '${{ fromJson(steps.ReadSecrets.outputs.Secrets).AZURE_CREDENTIALS }}'
|
||||
pathToFiles: '${{ inputs.project }}/.buildartifacts/Apps/*.app'
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче