Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
"version": 1,
"isRoot": true,
"tools": {
"dotnet-sonarscanner": {
"version": "7.1.1",
"commands": [
"dotnet-sonarscanner"
]
},
"microsoft.sbom.dotnettool": {
"version": "2.2.6",
"version": "2.2.7",
"commands": [
"sbom-tool"
]
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
version:
required: true
type: string
secrets:
SONAR_TOKEN:
required: true


jobs:
build:
Expand All @@ -32,6 +36,18 @@ jobs:
run: >
dotnet restore

- name: Start Sonar Scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
dotnet dotnet-sonarscanner
begin
/k:"demaconsulting_SpdxTool"
/o:"demaconsulting"
/d:sonar.token="${{ secrets.SONAR_TOKEN }}"
/d:sonar.host.url="https://sonarcloud.io"
/d:sonar.cs.opencover.reportsPaths=**/*.opencover.xml

- name: Build
run: >
dotnet build
Expand All @@ -45,7 +61,16 @@ jobs:
--no-build
--configuration Release
--property:Version=${{ inputs.version }}
--collect "XPlat Code Coverage;Format=opencover"

- name: End Sonar Scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
dotnet dotnet-sonarscanner
end
/d:sonar.token="${{ secrets.SONAR_TOKEN }}"

- name: Generate Tool SBOM
run: >
dotnet sbom-tool generate
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ jobs:
with:
os: windows-latest
version: 0.0.0-run.${{ github.run_number }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build-linux:
name: Build Linux
uses: ./.github/workflows/build.yaml
with:
os: ubuntu-latest
version: 0.0.0-run.${{ github.run_number }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
with:
os: ubuntu-latest
version: ${{ inputs.version }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

release:
permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.1" />
</ItemGroup>

<ItemGroup>
Expand Down