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

Resolves: Add a CI pipeline with GitHub Actions #944

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
662a945
Create CI Pipeline (#4)
aleks-ivanov Aug 3, 2021
0a89e0e
Merge branch 'master' into feature/ci-cd
aleks-ivanov Aug 24, 2021
a686c36
Merge branch 'master' into feature/ci-cd
aleks-ivanov Aug 25, 2021
88f8f3e
Merge branch 'master' into feature/ci-cd
aleks-ivanov Aug 27, 2021
7197f02
Merge branch 'master' into feature/ci-cd
aleks-ivanov Aug 28, 2021
79d03de
Merge branch 'master' into feature/ci-cd
aleks-ivanov Sep 1, 2021
e758eaa
Merge branch 'master' into feature/ci-cd
aleks-ivanov Oct 1, 2021
92c98d0
Merge branch 'master' into feature/ci-cd
aleks-ivanov Oct 5, 2021
d8a6489
Merge branch 'master' into feature/ci-cd
aleks-ivanov Oct 13, 2021
26af903
Merge branch 'master' into feature/ci-cd
aleks-ivanov Oct 28, 2021
3926e60
Merge branch 'master' into feature/ci-cd
aleks-ivanov Nov 3, 2021
18e2e21
Merge branch 'master' into feature/ci-cd
aleks-ivanov Nov 18, 2021
c464946
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jan 7, 2022
837479a
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jan 12, 2022
974ea44
Merge branch 'master' into feature/ci-cd
aleks-ivanov Feb 9, 2022
1983a3f
Merge branch 'master' into feature/ci-cd
aleks-ivanov Mar 17, 2022
88c6e9f
Merge branch 'master' into feature/ci-cd
aleks-ivanov Mar 25, 2022
832526f
Merge branch 'master' into feature/ci-cd
aleks-ivanov Mar 29, 2022
0b8898b
Merge branch 'master' into feature/ci-cd
aleks-ivanov Mar 30, 2022
c52917e
Merge branch 'master' into feature/ci-cd
aleks-ivanov Apr 27, 2022
dd73449
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 6, 2022
05094df
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 10, 2022
48c8d98
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 12, 2022
f1136a7
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 13, 2022
9ed2f0a
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 15, 2022
b048aae
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 17, 2022
eac8c46
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 19, 2022
380c6ac
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 24, 2022
fc8f50a
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 27, 2022
c6e72ca
Merge branch 'master' into feature/ci-cd
aleks-ivanov May 28, 2022
a9a18fd
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jun 2, 2022
3708b6e
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jun 7, 2022
1246c25
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jun 10, 2022
9462301
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jun 15, 2022
3d086f3
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jun 16, 2022
e43d7a2
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jun 18, 2022
de8e8d0
Merge branch 'master' into feature/ci-cd
aleks-ivanov Jun 21, 2022
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
102 changes: 102 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: CI Pipeline

on: [ push, pull_request, workflow_dispatch ]

jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
env:
pathToSolution: Microsoft.Diagnostics.Runtime.sln
testResultsFolderName: Test results
publishOutputFolderName: Publish output
steps:
- name: Checkout repository
uses: actions/checkout@v2

# Tooling setup

- name: Install .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.411

- name: Install .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.302

# Build and test validation

- name: Restore solution
shell: pwsh
run: |
$pathToSolution = "${{ env.pathToSolution }}"

dotnet restore $pathToSolution

- name: Build solution
shell: pwsh
run: |
$pathToSolution = "${{ env.pathToSolution }}"
$configurationSetting = "Debug"

dotnet build $pathToSolution `
--configuration $configurationSetting `
--no-restore

- name: Run unit tests
continue-on-error: true
shell: pwsh
run: |
$pathToSolution = "${{ env.pathToSolution }}"
$pathToTestTargets = "src/TestTargets/TestTargets.proj"
$configurationSetting = "Debug"
$loggerAttributes = "trx;LogFilePath=TestResults.trx;verbosity=normal"
$testOutputFolder = "${{ env.testResultsFolderName }}"

dotnet build $pathToTestTargets `
--configuration $configurationSetting

dotnet test $pathToSolution `
--configuration $configurationSetting `
--logger $loggerAttributes `
--results-directory $testOutputFolder `
--no-build

# Artifact generation

- name: Publish project for each target framework
shell: pwsh
run: |
$pathToProject = "src/Microsoft.Diagnostics.Runtime/Microsoft.Diagnostics.Runtime.csproj"
$configurationSetting = "Debug"
$publishOutputFolder = "${{ env.publishOutputFolderName }}"
$targetFrameworksProperty = [String](([xml](Get-Content -Path $pathToProject)).Project.PropertyGroup.TargetFrameworks)
$targetFrameworks = $targetFrameworksProperty.split(';')

foreach ( $framework in $targetFrameworks ) {
$frameworkNum = [String]($framework -replace ' ', '')

dotnet publish $pathToProject `
--configuration $configurationSetting `
--output "$publishOutputFolder/$frameworkNum" `
--framework $frameworkNum `
--no-restore
}

# Artifact publish to pipeline

- name: Upload test results as pipeline artifact
uses: actions/upload-artifact@v2
with:
name: Test results
path: ${{ env.testResultsFolderName }}

- name: Upload publish output as pipeline artifact
uses: actions/upload-artifact@v2
with:
name: Publish output
path: ${{ env.publishOutputFolderName }}

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
1 change: 1 addition & 0 deletions src/TestTargets/Types/Types.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
Expand Down