-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
222 additions
and
99 deletions.
There are no files selected for viewing
This file contains 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,99 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- microbuild | ||
- validate/* | ||
pull_request: | ||
|
||
env: | ||
TreatWarningsAsErrors: true | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
BUILDCONFIGURATION: Release | ||
codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 # Get a new one from https://codecov.io/ | ||
ci_feed: /a5a3bad0-e566-4c53-be83-6458be8d1653 # find guid used by Azure DevOps Artifacts for the feed. Learn more at https://github.com/AArnott/Library.Template/issues/28 | ||
# NUGET_PACKAGES: ${{ env.GITHUB_WORKSPACE }}/.nuget/packages | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-18.04 | ||
- macos-latest | ||
- windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deep clone | ||
run: git fetch --prune --unshallow origin HEAD | ||
- name: Install prerequisites | ||
run: | | ||
./init.ps1 -UpgradePrerequisites | ||
dotnet --info | ||
shell: pwsh | ||
- name: Set pipeline variables based on source | ||
run: azure-pipelines/variables/_pipelines.ps1 | ||
shell: pwsh | ||
- name: build | ||
run: dotnet build src --no-restore -c ${{ env.BUILDCONFIGURATION }} /v:m /bl:"bin/build_logs/build.binlog" | ||
- name: pack | ||
run: dotnet pack src --no-build -c ${{ env.BUILDCONFIGURATION }} /v:m /bl:"bin/build_logs/pack.binlog" | ||
- name: test | ||
run: dotnet test src --no-build -c ${{ env.BUILDCONFIGURATION }} /bl:"bin/build_logs/test.binlog" --filter "TestCategory!=FailsInCloudTest" -v n /p:CollectCoverage=true | ||
- name: Update pipeline variables based on build outputs | ||
run: azure-pipelines/variables/_pipelines.ps1 | ||
shell: pwsh | ||
- name: Collect artifacts | ||
run: azure-pipelines/artifacts/_stage_all.ps1 | ||
shell: pwsh | ||
- name: Upload project.assets.json files | ||
if: always() | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: projectAssetsJson-${{ runner.os }} | ||
path: obj/_artifacts/projectAssetsJson | ||
continue-on-error: true | ||
- name: Upload variables | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: variables | ||
path: obj/_artifacts/variables | ||
if: runner.os == 'Windows' | ||
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 | ||
continue-on-error: true | ||
- name: Upload coverageResults | ||
if: always() | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: coverageResults-${{ runner.os }} | ||
path: obj/_artifacts/coverageResults | ||
continue-on-error: true | ||
- name: Upload symbols | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: symbols | ||
path: obj/_artifacts/symbols | ||
if: runner.os == 'Windows' | ||
continue-on-error: true | ||
- name: Upload deployables | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: deployables | ||
path: obj/_artifacts/deployables | ||
if: runner.os == 'Windows' | ||
- name: Publish code coverage results to codecov.io | ||
run: bash <(curl -s https://codecov.io/bash) | ||
shell: bash | ||
timeout-minutes: 3 | ||
continue-on-error: true |
This file contains 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 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 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 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 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 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 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,59 @@ | ||
# This script links all the artifacts described by _all.ps1 | ||
# into a staging directory, reading for uploading to a cloud build artifact store. | ||
# It returns a sequence of objects with Name and Path properties. | ||
|
||
param ( | ||
[string]$ArtifactNameSuffix | ||
) | ||
|
||
$RepoRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot (Join-Path .. ..))) | ||
if ($env:BUILD_ARTIFACTSTAGINGDIRECTORY) { | ||
$ArtifactStagingFolder = $env:BUILD_ARTIFACTSTAGINGDIRECTORY | ||
} else { | ||
$ArtifactStagingFolder = Join-Path $RepoRoot (Join-Path obj _artifacts) | ||
if (Test-Path $ArtifactStagingFolder) { | ||
Remove-Item $ArtifactStagingFolder -Recurse -Force | ||
} | ||
} | ||
|
||
function Create-SymbolicLink { | ||
param ( | ||
$Link, | ||
$Target | ||
) | ||
|
||
if ($Link -eq $Target) { | ||
return | ||
} | ||
|
||
if (Test-Path $Link) { Remove-Item $Link } | ||
$LinkContainer = Split-Path $Link -Parent | ||
if (!(Test-Path $LinkContainer)) { mkdir $LinkContainer } | ||
Write-Verbose "Linking $Link to $Target" | ||
if ($IsMacOS -or $IsLinux) { | ||
ln $Target $Link | Out-Null | ||
} else { | ||
cmd /c mklink $Link $Target | Out-Null | ||
} | ||
} | ||
|
||
# Stage all artifacts | ||
$Artifacts = & "$PSScriptRoot\_all.ps1" | ||
$Artifacts |% { | ||
$DestinationFolder = (Join-Path (Join-Path $ArtifactStagingFolder "$($_.ArtifactName)$ArtifactNameSuffix") $_.ContainerFolder).TrimEnd('\') | ||
$Name = "$(Split-Path $_.Source -Leaf)" | ||
|
||
#Write-Host "$($_.Source) -> $($_.ArtifactName)\$($_.ContainerFolder)" -ForegroundColor Yellow | ||
|
||
if (-not (Test-Path $DestinationFolder)) { New-Item -ItemType Directory -Path $DestinationFolder | Out-Null } | ||
if (Test-Path -PathType Leaf $_.Source) { # skip folders | ||
Create-SymbolicLink -Link (Join-Path $DestinationFolder $Name) -Target $_.Source | ||
} | ||
} | ||
|
||
$Artifacts |% { "$($_.ArtifactName)$ArtifactNameSuffix" } | Get-Unique |% { | ||
$artifact = New-Object -TypeName PSObject | ||
Add-Member -InputObject $artifact -MemberType NoteProperty -Name Name -Value $_ | ||
Add-Member -InputObject $artifact -MemberType NoteProperty -Name Path -Value (Join-Path $ArtifactStagingFolder $_) | ||
Write-Output $artifact | ||
} |
This file contains 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 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.