Skip to content

Commit

Permalink
ci: add github action to build and test dotnet
Browse files Browse the repository at this point in the history
  • Loading branch information
tjorbo authored and umoelli committed Mar 4, 2024
1 parent c4f7d40 commit c3f7f7a
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: tool-manifest and local install tools
run: |
dotnet new tool-manifest
dotnet tool install --local JetBrains.ReSharper.GlobalTools
dotnet tool install --local CycloneDX
dotnet tool install --local dotnet-coverage
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: |
dotnet test --no-build --verbosity normal --filter TestCategory!=Integrationtest --settings Default.runsettings --logger trx /p:CollectCoverage=true /maxcpucount:1 --collect:"XPlat Code Coverage" --results-directory TestResultsCI /p:CoverletOutput="../TestResultsCI/"
dotnet dotnet-coverage collect "dotnet test --filter TestCategory!=Integrationtest --no-restore --no-build" -f xml -o "coverage.xml"
- name: jetbrains resharper inspectcode
run: dotnet jb inspectcode --no-build "Dataport.Terminfinder.sln" -o="codeInspection.xml" --disable-settings-layers:SolutionPersonal -e:WARNING --no-swea
- name: Upload resharper file
uses: actions/upload-artifact@v4
with:
name: jetbrains resharper codeInspection
path: "src/codeInspection.xml"
- name: Upload code coverage file
uses: actions/upload-artifact@v4
with:
name: code coverage
path: "src/coverage.xml"
- name: sbom
run: dotnet dotnet-CycloneDX Dataport.Terminfinder.sln -t -f "sbom.xml"
- name: Upload sbom file
uses: actions/upload-artifact@v4
with:
name: CycloneDX sbom
path: "src/sbom.xml"

0 comments on commit c3f7f7a

Please sign in to comment.