Skip to content
Open
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
9 changes: 7 additions & 2 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ extends:
displayName: 'Use .NET 8'
inputs:
version: 8.x

- task: UseDotNet@2
displayName: 'Use .NET 10'
inputs:
version: 10.x

# Install the nuget tool.
- task: NuGetToolInstaller@1
Expand All @@ -77,15 +82,15 @@ extends:
- task: DotNetCoreCLI@2
displayName: 'build'
inputs:
projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.sln'
projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.slnx'
arguments: '--configuration $(BuildConfiguration) --no-incremental'

# Run the Unit test
- task: DotNetCoreCLI@2
displayName: 'test'
inputs:
command: test
projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.sln'
projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.slnx'
arguments: '--configuration $(BuildConfiguration) --no-build'

- task: EsrpCodeSigning@5
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ jobs:
ARTIFACTS_FOLDER: ${{ github.workspace }}/Artifacts
GITHUB_RUN_NUMBER: ${{ github.run_number }}
steps:
- name: Setup .NET
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x

- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x

- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v6
Expand All @@ -29,27 +34,32 @@ jobs:
id: build_projects
shell: pwsh
run: |
dotnet build Microsoft.OpenApi.sln -c Release
dotnet build Microsoft.OpenApi.slnx -c Release

- name: Run unit tests
id: run_unit_tests
shell: pwsh
run: |
dotnet test Microsoft.OpenApi.sln -c Release -v n
dotnet test Microsoft.OpenApi.slnx -c Release -v n

validate-trimming:
name: Validate Project for Trimming
runs-on: windows-latest
steps:
- uses: actions/checkout@v6

- name: Setup .NET
- name: Setup .NET 8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we remove this? won't the step above overwrite this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's because our library is that we're publishing our targeting this version, so we need both versions to be installed locally for the whole process to go through successfully.
Sometimes some versions of the SDK are pre-installed on the machine but when those things gets changed, this is when your pipelines start breaking for no reason at all.
You should always install all the versions you need and if a version is already present it will result in no operation. If it's absent it will be installed, but at least you insure this way that you have all the things you need to produce the artifact you want to produce.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, most sdks will stay from.net to node.js and etc. Are able to have multiple versions co-located in the same box without resulting into conflicts or suppressions

uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x

- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x

- name: Validate Trimming warnings
run: dotnet publish -c Release -r win-x64 /p:TreatWarningsAsErrors=true /warnaserror -f net8.0
run: dotnet publish -c Release -r win-x64 /p:TreatWarningsAsErrors=true /warnaserror -f net10.0
working-directory: ./test/Microsoft.OpenApi.Trimming.Tests

validate-performance:
Expand All @@ -60,11 +70,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup .NET
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x

- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x

- name: Copy committed results
run: |
mkdir -p ./performanceResults
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ jobs:
id: checkout_repo
uses: actions/checkout@v6

- name: Setup .NET
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x

- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x

- name: Initialize CodeQL
id: init_codeql
uses: github/codeql-action/init@v4
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ jobs:
with:
distribution: 'adopt'
java-version: 17
- name: Setup .NET
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
Expand All @@ -64,5 +68,5 @@ jobs:
dotnet tool run dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="test/**/coverage.opencover.xml"
dotnet workload restore
dotnet build
dotnet test Microsoft.OpenApi.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
dotnet test Microsoft.OpenApi.slnx --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"group": "build",
"args": [
"build",
"${workspaceFolder}/Microsoft.OpenApi.sln",
"${workspaceFolder}/Microsoft.OpenApi.slnx",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -23,7 +23,7 @@
"group": "test",
"args": [
"test",
"${workspaceFolder}/Microsoft.OpenApi.sln",
"${workspaceFolder}/Microsoft.OpenApi.slnx",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary",
"--collect:\"XPlat Code Coverage\""
Expand Down
103 changes: 0 additions & 103 deletions Microsoft.OpenApi.sln

This file was deleted.

23 changes: 23 additions & 0 deletions Microsoft.OpenApi.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Solution>
<Folder Name="/performance/">
<Project Path="performance/resultsComparer/resultsComparer.csproj" />
</Folder>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path="build.cmd" />
<File Path="readme.md" />
</Folder>
<Folder Name="/src/">
<Project Path="src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj" />
<Project Path="src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj" />
<Project Path="src/Microsoft.OpenApi.YamlReader/Microsoft.OpenApi.YamlReader.csproj" />
<Project Path="src/Microsoft.OpenApi/Microsoft.OpenApi.csproj" />
</Folder>
<Folder Name="/test/">
<Project Path="test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj" />
<Project Path="test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj" />
<Project Path="test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj" />
<Project Path="test/Microsoft.OpenApi.Trimming.Tests/Microsoft.OpenApi.Trimming.Tests.csproj" />
</Folder>
<Project Path="performance/benchmark/PerformanceTests.csproj" />
</Solution>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ In order to test the validity of an OpenApi document, we avail the following too
#### Installation guidelines:
1. Clone the repo locally by running this command:
`git clone https://github.com/microsoft/OpenAPI.NET.git`
2. Open the solution file `(.sln)` in the root of the project with Visual Studio
2. Open the solution file `(.slnx)` in the root of the project with Visual Studio
3. Navigate to the `src/Microsoft.OpenApi.Workbench` directory and set it as the startup project
4. Run the project and you'll see a GUI pop up resembling the one below:

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "8.0.419"
"version": "10.0.202"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Microsoft.OpenApi.Tests.UtilityFiles
/// <summary>
/// Mock class that creates a sample OpenAPI document.
/// </summary>
public static class OpenApiDocumentMock
internal static class OpenApiDocumentMock
{
/// <summary>
/// Creates an OpenAPI document.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\src\Microsoft.OpenApi.snk</AssemblyOriginatorKeyFile>
Expand All @@ -15,11 +15,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="coverlet.msbuild" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="system.text.json" Version="9.0.10" />
<PackageReference Include="coverlet.collector" Version="8.0.1" PrivateAssets="all" />
<PackageReference Include="coverlet.msbuild" Version="8.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageReference Include="FluentAssertions" Version="7.2.2" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="all" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<SignAssembly>true</SignAssembly>
<OutputType>Library</OutputType>
Expand All @@ -13,11 +13,9 @@
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="System.Text.Json" Version="9.0.10" />
<PackageReference Include="Verify.Xunit" Version="31.12.5" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishTrimmed>true</PublishTrimmed>
Expand Down
Loading