Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into zip-support
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelcfanning committed Nov 13, 2024
2 parents d5f0727 + a4a0d6d commit 6fe2a54
Show file tree
Hide file tree
Showing 23 changed files with 230 additions and 234 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/build-and-test.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/build-multitool-for-npm.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/dotnet-format.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Validate
on:
push:
branches: ["main"]
pull_request:
branches: [ "main" ]

jobs:
#########################################################################
build-and-test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
runs-on: ${{matrix.os}}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
# GitHelper unit test requires full clone, not the shallow default of GitHub Actions
fetch-depth: 0

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
6.0.x
- name: Show dotnet info
run: dotnet --info

- name: Build and Test
# NoFormat because there is a separate format check action below
run: pwsh ./scripts/BuildAndTest.ps1 -NoFormat

#########################################################################
build-multitool-for-npm:
runs-on: windows-latest
steps:
- name: Checkout out code
uses: actions/checkout@v4

- name: Build Multitool for npm
run: ./scripts/BuildMultitoolForNpm.ps1

#########################################################################
check-format:
runs-on: windows-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Install format tool
run: dotnet tool install -g dotnet-format

- name: dotnet format
run: dotnet-format --folder --check --exclude .\src\Sarif\Autogenerated\
14 changes: 9 additions & 5 deletions scripts/BuildAndTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ param(
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$InformationPreference = "Continue"
$OnWindows = $Env:OS -eq 'Windows_NT'
$NonWindowsOptions = @{}

$ScriptName = $([io.Path]::GetFileNameWithoutExtension($PSCommandPath))
Expand All @@ -106,6 +107,9 @@ function Invoke-DotNetBuild($solutionFileRelativePath) {
function Publish-Application($project, $framework) {
Write-Information "Publishing $project for $framework ..."
dotnet publish $SourceRoot\$project\$project.csproj --no-build --configuration $Configuration --framework $framework
if ($LASTEXITCODE -ne 0) {
Exit-WithFailureMessage $ScriptName "Publish failed."
}
}

# Create a directory populated with the binaries that need to be signed.
Expand Down Expand Up @@ -216,13 +220,13 @@ if (-not $?) {

if (-not $NoBuild) {
Invoke-DotNetBuild $SolutionFile
if ($ENV:OS) {
if ($OnWindows) {
Invoke-DotNetBuild $sampleSolutionFile
}
}

if (-not $NoTest) {
if (-not $ENV:OS) {
if (-not $OnWindows) {
$NonWindowsOptions = @{ "-filter" = "WindowsOnly!=true" }
}
& dotnet test $SourceRoot\$SolutionFile --no-build --configuration $Configuration @NonWindowsOptions
Expand All @@ -231,7 +235,7 @@ if (-not $NoTest) {
}
}

if (-not $NoPublish) {
if (-not $NoPublish -and $OnWindows) { # Can't publish on non-windows due to not building net4x assets
foreach ($project in $Projects.Applications) {
foreach ($framework in $Frameworks.Application) {
Publish-Application $project $framework
Expand All @@ -243,9 +247,9 @@ if (-not $NoSigningDirectory) {
New-SigningDirectory
}

if (-not $NoPackage) {
if (-not $NoPackage -and $OnWindows) { # Can't package on non-windows due to not building net4x assets
& dotnet pack $SourceRoot\$SolutionFile --no-build --configuration $Configuration
if ($ENV:OS -and $LASTEXITCODE -ne 0) {
if ($LASTEXITCODE -ne 0) {
Exit-WithFailureMessage $ScriptName "Package failed."
}
}
Expand Down
45 changes: 45 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Azure.Core" Version="1.41.0" />
<PackageVersion Include="Azure.Identity" Version="1.12.1" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
<PackageVersion Include="CsvHelper" Version="15.0.5" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="2.1.7" />
<PackageVersion Include="Microsoft.Diagnostics.Tracing.EventRegister" Version="1.1.28" />
<PackageVersion Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.3" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="3.1.2" />
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="3.1.9" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.2" />
<PackageVersion Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.20.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="3.1.2" />
<PackageVersion Include="Microsoft.Json.Pointer" Version="2.1.0" />
<PackageVersion Include="Microsoft.Json.Schema" Version="2.1.0" />
<PackageVersion Include="Microsoft.Json.Schema.Validation" Version="2.1.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.TeamFoundationServer.Client" Version="16.170.0" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="System.Collections.Immutable" Version="5.0.0" />
<PackageVersion Include="System.Composition" Version="5.0.0" />
<PackageVersion Include="System.Data.SqlClient" Version="4.8.6" />
<PackageVersion Include="System.Diagnostics.Debug" Version="4.3.0" />
<PackageVersion Include="System.IO.Compression" Version="4.3.0" />
<PackageVersion Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="4.3.0" />
<PackageVersion Include="System.Text.Encoding.Extensions" Version="4.3.0" />
<PackageVersion Include="System.Text.Encodings.Web" Version="5.0.1" />
<PackageVersion Include="System.Threading.Channels" Version="5.0.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.console" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="YamlDotNet" Version="11.2.0" />
</ItemGroup>
</Project>
18 changes: 9 additions & 9 deletions src/Sarif.Converters/Sarif.Converters.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@
<ItemGroup>
<!-- We have to ship pre-patch versions of NewtonSoft for VisualStudio SDK.
We mitigate risk by limiting nesting depth. -->
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" NoWarn="NU1903" />
<PackageReference Include="Newtonsoft.Json" VersionOverride="9.0.1" NoWarn="NU1903" />

<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.Extensions" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" />
<PackageReference Include="System.Text.Encoding.Extensions" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<!-- We have to ship pre-patch versions of NewtonSoft for VisualStudio SDK.
We mitigate risk by limiting nesting depth. -->
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" NoWarn="NU1903" />
<PackageReference Include="Newtonsoft.Json" VersionOverride="9.0.1" NoWarn="NU1903" />
</ItemGroup>
</Otherwise>
</Choose>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="15.0.5" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="YamlDotNet" Version="11.2.0" />
<PackageReference Include="CsvHelper" />
<PackageReference Include="System.Collections.Immutable" />
<PackageReference Include="System.IO.Compression" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="YamlDotNet" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 9 additions & 9 deletions src/Sarif.Driver/Sarif.Driver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="3.1.9" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="System.Composition" Version="5.0.0" />
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.Extensions" Version="4.3.0" />
<PackageReference Include="System.Threading.Channels" Version="5.0.0" />
<PackageReference Include="CommandLineParser" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="System.Composition" />
<PackageReference Include="System.Diagnostics.Debug" />
<PackageReference Include="System.IO.FileSystem.Primitives" />
<PackageReference Include="System.Text.Encoding.Extensions" />
<PackageReference Include="System.Threading.Channels" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 9 additions & 9 deletions src/Sarif.Multitool.Library/Sarif.Multitool.Library.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.1" />
<PackageReference Include="Azure.Core" Version="1.41.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.7" />
<PackageReference Include="Microsoft.Json.Pointer" Version="2.1.0" />
<PackageReference Include="Microsoft.Json.Schema" Version="2.1.0" />
<PackageReference Include="Microsoft.Json.Schema.Validation" Version="2.1.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="System.Threading.Channels" Version="5.0.0" />
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Azure.Core" />
<PackageReference Include="Microsoft.Data.SqlClient" />
<PackageReference Include="Microsoft.Json.Pointer" />
<PackageReference Include="Microsoft.Json.Schema" />
<PackageReference Include="Microsoft.Json.Schema.Validation" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="System.Threading.Channels" />

<!-- We have to ship pre-patch versions of NewtonSoft for VisualStudio SDK.
We mitigate risk by limiting nesting depth. -->
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" NoWarn="NU1903" />
<PackageReference Include="Newtonsoft.Json" VersionOverride="12.0.3" NoWarn="NU1903" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Sarif.Multitool/Sarif.Multitool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
<PackageReference Include="CommandLineParser" />
<PackageReference Include="System.Private.Uri" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.WorkItems/Sarif.WorkItems.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ItemGroup>
<!-- We have to ship pre-patch versions of NewtonSoft for VisualStudio SDK.
We mitigate risk by limiting nesting depth. -->
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" NoWarn="NU1903" />
<PackageReference Include="Newtonsoft.Json" VersionOverride="12.0.3" NoWarn="NU1903" />
</ItemGroup>

<ItemGroup>
Expand Down
22 changes: 11 additions & 11 deletions src/Sarif/Sarif.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@
<Choose>
<When Condition="$(TargetFramework) == 'netstandard2.0'">
<ItemGroup>
<!-- We have to ship pre-patch versions of NewtonSoft for VisualStudio SDK.
<!-- We have to ship pre-patch versions of NewtonSoft for VisualStudio SDK.
We mitigate risk by limiting nesting depth. -->
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" NoWarn="NU1903" />
<PackageReference Include="Newtonsoft.Json" VersionOverride="9.0.1" NoWarn="NU1903" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="6.0.8" NoWarn="NU1903" />
<PackageReference Include="Newtonsoft.Json" VersionOverride="6.0.8" NoWarn="NU1903" />
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
</ItemGroup>
</Otherwise>
</Choose>

<ItemGroup>
<PackageReference Include="Microsoft.Diagnostics.Tracing.EventRegister" Version="1.1.28" Condition="$(OS) == 'Windows_NT'" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.Extensions" Version="4.3.0" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.EventRegister" Condition="$(OS) == 'Windows_NT'" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="System.Collections.Immutable" />
<PackageReference Include="System.Diagnostics.Debug" />
<PackageReference Include="System.IO.FileSystem.Primitives" />
<PackageReference Include="System.Text.Encoding.CodePages" />
<PackageReference Include="System.Text.Encoding.Extensions" />
</ItemGroup>

<ItemGroup Label="Packaging">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="CommandLineParser" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 6fe2a54

Please sign in to comment.