Skip to content

Commit cdf9f84

Browse files
authored
Merge pull request #1395 from microsoft/andrueastman/IgnoreTrailingWhitespace
Fixex PR validation
2 parents fa716cf + a99db00 commit cdf9f84

File tree

3 files changed

+6
-79
lines changed

3 files changed

+6
-79
lines changed

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -59,85 +59,10 @@ jobs:
5959
id: build_projects
6060
shell: pwsh
6161
run: |
62-
$projectsArray = @(
63-
'.\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj',
64-
'.\src\Microsoft.OpenApi.Readers\Microsoft.OpenApi.Readers.csproj',
65-
'.\src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj'
66-
)
67-
$gitNewVersion = if ("${{ steps.tag_generator.outputs.new_version }}") {"${{ steps.tag_generator.outputs.new_version }}"} else {$null}
68-
$projectCurrentVersion = ([xml](Get-Content .\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj)).Project.PropertyGroup.Version
69-
$projectNewVersion = $gitNewVersion ?? $projectCurrentVersion
70-
71-
$projectsArray | ForEach-Object {
72-
dotnet build $PSItem `
73-
-c Release # `
74-
# -o $env:ARTIFACTS_FOLDER `
75-
# /p:Version=$projectNewVersion
76-
}
77-
78-
# Move NuGet packages to separate folder for pipeline convenience
79-
# New-Item Artifacts/NuGet -ItemType Directory
80-
# Get-ChildItem Artifacts/*.nupkg | Move-Item -Destination "Artifacts/NuGet"
62+
dotnet build Microsoft.OpenApi.sln -c Release
8163
8264
- name: Run unit tests
8365
id: run_unit_tests
8466
shell: pwsh
8567
run: |
86-
$testProjectsArray = @(
87-
'.\test\Microsoft.OpenApi.Tests\Microsoft.OpenApi.Tests.csproj',
88-
'.\test\Microsoft.OpenApi.Readers.Tests\Microsoft.OpenApi.Readers.Tests.csproj',
89-
'.\test\Microsoft.OpenApi.SmokeTests\Microsoft.OpenApi.SmokeTests.csproj'
90-
)
91-
92-
$testProjectsArray | ForEach-Object {
93-
dotnet test $PSItem `
94-
-c Release
95-
}
96-
97-
# - if: steps.tag_generator.outputs.new_version != ''
98-
# name: Upload NuGet packages as artifacts
99-
# id: ul_packages_artifact
100-
# uses: actions/upload-artifact@v1
101-
# with:
102-
# name: NuGet packages
103-
# path: Artifacts/NuGet/
104-
105-
cd:
106-
if: needs.ci.outputs.is_default_branch == 'true' && needs.ci.outputs.latest_version != ''
107-
name: Continuous Deployment
108-
needs: ci
109-
runs-on: ubuntu-latest
110-
steps:
111-
# - name: Download and extract NuGet packages
112-
# id: dl_packages_artifact
113-
# uses: actions/download-artifact@v2
114-
# with:
115-
# name: NuGet packages
116-
# path: NuGet/
117-
118-
# - name: Push NuGet packages to NuGet.org
119-
# id: push_nuget_packages
120-
# continue-on-error: true
121-
# shell: pwsh
122-
# run: |
123-
# Get-ChildItem NuGet/*.nupkg | ForEach-Object {
124-
# nuget push $PSItem `
125-
# -ApiKey $env:NUGET_API_KEY `
126-
# -Source https://api.nuget.org/v3/index.json
127-
# }
128-
# env:
129-
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
130-
131-
- name: Create and publish release
132-
id: create_release
133-
uses: softprops/action-gh-release@v1
134-
with:
135-
name: OpenApi v${{ needs.ci.outputs.latest_version }}
136-
tag_name: v${{ needs.ci.outputs.latest_version }}
137-
# files: |
138-
# NuGet/Microsoft.OpenApi.${{ needs.ci.outputs.latest_version }}.nupkg
139-
# NuGet/Microsoft.OpenApi.Readers.${{ needs.ci.outputs.latest_version }}.nupkg
140-
env:
141-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142-
143-
# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
68+
dotnet test Microsoft.OpenApi.sln -c Release -v n

src/Microsoft.OpenApi/Services/OpenApiWorkspace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public OpenApiWorkspace(Uri baseUrl)
5757
/// </summary>
5858
public OpenApiWorkspace()
5959
{
60-
BaseUrl = new Uri("file://" + Environment.CurrentDirectory + "\\" );
60+
BaseUrl = new Uri("file://" + Environment.CurrentDirectory + $"{Path.DirectorySeparatorChar}" );
6161
}
6262

6363
/// <summary>

test/Microsoft.OpenApi.Tests/StringExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public static string MakeLineBreaksEnvironmentNeutral(this string input)
1818
{
1919
return input.Replace("\r\n", "\n")
2020
.Replace('\r', '\n')
21-
.Replace("\n", Environment.NewLine);
21+
.Replace("\n", Environment.NewLine)
22+
.Replace($" {Environment.NewLine}", Environment.NewLine)// also cleanup new lines preceded with spaces
23+
.TrimEnd();
2224
}
2325
}
2426
}

0 commit comments

Comments
 (0)