pipline #443
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
name: .NET | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build | |
- name: Test | |
run: dotnet test /p:CollectCoverage=true /p:CoverletOutput=coverage /p:CoverletOutputFormat=opencover | |
- name: Copy coverage files | |
run: | | |
mkdir '${{ github.workspace }}/coverage' | |
find . -name "*.opencover.xml" -exec sh -c 'cp "$0" "coverage/coverage-$(basename $0)"' {} \; | |
- name: List coverage files | |
run: ls '${{ github.workspace }}/coverage/' | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
with: | |
args: > | |
-Dsonar.organization=managedcode | |
-Dsonar.projectKey=managedcode_Storage | |
-Dsonar.token=${{ secrets.SONAR_TOKEN }} | |
-Dsonar.cs.opencover.reportsPaths=${{ github.workspace }}/coverage/ | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: NDepend | |
uses: ndepend/ndepend-action@v1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
license: ${{ secrets.NDEPENDLICENSE }} | |
coveragefolder: ${{ github.workspace }}/coverage/ | |
baseline: main_recent | |
retention-days: 15 | |
#stopIfQGFailed: true | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |