-
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#476): Replace Azure DevOps pipeline with GitHub Actions
- Loading branch information
1 parent
f3096c0
commit 55984d7
Showing
16 changed files
with
246 additions
and
230 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,120 @@ | ||
name: Continuous Integration & Delivery | ||
|
||
on: | ||
push: | ||
branches: [ develop, master, bugfix/*, feature/* ] | ||
pull_request: | ||
branches: [ develop, master ] | ||
|
||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
DOTNET_NOLOGO: true | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
DOTNET_VERSION: 6.0.x | ||
TZ: CET # https://stackoverflow.com/q/53510011 | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
clean: true | ||
lfs: true | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Restore .NET Tools | ||
run: dotnet tool restore | ||
|
||
- name: Restore NuGet Packages | ||
run: dotnet cake --target=Restore-NuGet-Packages | ||
|
||
- name: Run Build | ||
run: dotnet cake --target=Build | ||
|
||
- name: Run Tests | ||
run: dotnet cake --target=Tests --test-filter=FullyQualifiedName~${{ startsWith(matrix.os, 'ubuntu') && 'DotNet.Testcontainers' || 'DotNet.Testcontainers.Tests.Unit.Containers.Windows' }} | ||
|
||
- name: Get Logs | ||
run: Get-ChildItem -Path . -Include *.log -Recurse | % { Get-Content -Path $_.FullName } | ||
shell: pwsh | ||
|
||
- name: Rename Test And Coverage Results | ||
run: Get-ChildItem -Path 'test-coverage' -Filter *.xml | Rename-Item -NewName { $_.Name -Replace 'coverage', '${{ matrix.os }}'.ToLower() } | ||
shell: pwsh | ||
|
||
- name: Upload Test And Coverage Results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.os }} | ||
path: | | ||
test-coverage | ||
test-results | ||
publish: | ||
needs: build | ||
|
||
environment: ${{ contains(fromJson('["develop", "master"]'), github.ref_name) && 'production' || 'development' }} | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
env: | ||
FEED_SOURCE: https://api.nuget.org/v3/index.json | ||
FEED_APIKEY: ${{ secrets.FEED_APIKEY }} | ||
SONARCLOUD_URL: https://sonarcloud.io | ||
SONARCLOUD_ORGANIZATION: hofmeisteran-github | ||
SONARCLOUD_KEY: dotnet-testcontainers | ||
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
clean: true | ||
lfs: true | ||
fetch-depth: 0 | ||
|
||
- name: Download Test And Coverage Results (ubuntu-20.04) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ubuntu-20.04 | ||
|
||
- name: Download Test And Coverage Results (windows-2019) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: windows-2019 | ||
|
||
- name: Fix Absolute Code Coverage Paths | ||
run: | | ||
Get-ChildItem -Path 'test-coverage' -Filter *.xml | % { (Get-Content $_) -Replace '[A-Za-z0-9:\-\/\\]+src', '${{ github.workspace }}/src' | Set-Content $_ } | ||
Get-ChildItem -Path 'test-coverage' -Filter *.xml | % { (Get-Content $_) -Replace '[A-Za-z0-9:\-\/\\]+tests', '${{ github.workspace }}/tests' | Set-Content $_ } | ||
shell: pwsh | ||
|
||
- name: Restore .NET Tools | ||
run: dotnet tool restore | ||
|
||
- name: Restore NuGet Packages | ||
run: dotnet cake --target=Restore-NuGet-Packages | ||
|
||
- name: Run Sonar Analysis | ||
run: dotnet cake --target=Sonar-Begin | ||
|
||
- name: Run Build | ||
run: dotnet cake --target=Build | ||
|
||
- name: Upload Sonar Results | ||
run: dotnet cake --target=Sonar-End | ||
|
||
- name: Publish NuGet Package | ||
run: dotnet cake --target=Publish |
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
Oops, something went wrong.