Update GitHub Actions to more closely resemble AzP

This commit is contained in:
Andrew Arnott 2022-02-04 17:38:54 -07:00
Родитель 5b2c2195dc
Коммит e67a6e4b39
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: A9B9910CDCCDA441
4 изменённых файлов: 29 добавлений и 17 удалений

31
.github/workflows/build.yml поставляемый
Просмотреть файл

@ -34,14 +34,20 @@ jobs:
run: |
./init.ps1 -UpgradePrerequisites
dotnet --info
# Print mono version if it is present.
if (Get-Command mono -ErrorAction SilentlyContinue) {
mono --version
}
shell: pwsh
- name: Set pipeline variables based on source
run: azure-pipelines/variables/_pipelines.ps1
shell: pwsh
- name: build
run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} /v:m /bl:"bin/build_logs/build.binlog"
run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} /v:m /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog"
- name: test
run: dotnet test --no-build -c ${{ env.BUILDCONFIGURATION }} /bl:"bin/build_logs/test.binlog" --filter "TestCategory!=FailsInCloudTest" -v n /p:CollectCoverage=true --logger trx --blame-hang-timeout 30s --blame-crash
run: azure-pipelines/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }}
shell: pwsh
- name: Update pipeline variables based on build outputs
run: azure-pipelines/variables/_pipelines.ps1
shell: pwsh
@ -54,46 +60,53 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: projectAssetsJson-${{ runner.os }}
path: obj/_artifacts/projectAssetsJson
path: ${{ runner.temp }}/_artifacts/projectAssetsJson
continue-on-error: true
- name: Upload variables
uses: actions/upload-artifact@v1
with:
name: variables-${{ runner.os }}
path: obj/_artifacts/variables
path: ${{ runner.temp }}/_artifacts/Variables
continue-on-error: true
- name: Upload build_logs
if: always()
uses: actions/upload-artifact@v1
with:
name: build_logs-${{ runner.os }}
path: obj/_artifacts/build_logs
path: ${{ runner.temp }}/_artifacts/build_logs
continue-on-error: true
- name: Upload test_logs
if: always()
uses: actions/upload-artifact@v1
with:
name: test_logs-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/test_logs
continue-on-error: true
- name: Upload testResults
if: always()
uses: actions/upload-artifact@v1
with:
name: testResults-${{ runner.os }}
path: obj/_artifacts/testResults
path: ${{ runner.temp }}/_artifacts/testResults
continue-on-error: true
- name: Upload coverageResults
if: always()
uses: actions/upload-artifact@v1
with:
name: coverageResults-${{ runner.os }}
path: obj/_artifacts/coverageResults
path: ${{ runner.temp }}/_artifacts/coverageResults
continue-on-error: true
- name: Upload symbols
uses: actions/upload-artifact@v1
with:
name: symbols-${{ runner.os }}
path: obj/_artifacts/symbols
path: ${{ runner.temp }}/_artifacts/symbols
continue-on-error: true
- name: Upload deployables
uses: actions/upload-artifact@v1
with:
name: deployables-${{ runner.os }}
path: obj/_artifacts/deployables
path: ${{ runner.temp }}/_artifacts/deployables
if: always()
- name: Publish code coverage results to codecov.io
run: bash <(curl -s https://codecov.io/bash)

Просмотреть файл

@ -3,6 +3,8 @@ Param(
)
if ($env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
$ArtifactStagingFolder = $env:BUILD_ARTIFACTSTAGINGDIRECTORY
} elseif ($env:RUNNER_TEMP) {
$ArtifactStagingFolder = "$env:RUNNER_TEMP\_artifacts"
} else {
$ArtifactStagingFolder = [System.IO.Path]::GetFullPath("$PSScriptRoot/../obj/_artifacts")
if ($CleanIfLocal -and (Test-Path $ArtifactStagingFolder)) {

Просмотреть файл

@ -1,12 +1,7 @@
if ($env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
$artifactsRoot = $env:BUILD_ARTIFACTSTAGINGDIRECTORY
} else {
$RepoRoot = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\..")
$artifactsRoot = "$RepoRoot\bin"
}
$ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1"
if (!(Test-Path $artifactsRoot/build_logs)) { return }
if (!(Test-Path $ArtifactStagingFolder/build_logs)) { return }
@{
"$artifactsRoot/build_logs" = (Get-ChildItem -Recurse "$artifactsRoot/build_logs")
"$ArtifactStagingFolder/build_logs" = (Get-ChildItem -Recurse "$ArtifactStagingFolder/build_logs")
}

2
azure-pipelines/dotnet-test-cloud.ps1 Normal file → Executable file
Просмотреть файл

@ -1,3 +1,5 @@
#!/usr/bin/env pwsh
Param(
[string]$Configuration='Debug',
[string]$Agent='Local',