Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent NuGet audit warnings from failing the CI builds (Lombiq Technologies: OCORE-184) #16317

Merged
merged 12 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
3 changes: 2 additions & 1 deletion .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ jobs:
with:
dotnet-version: '8.0.x'
- name: Build
# See pr_ci.yml for the reason why we disable NuGet audit warnings.
run: |
dotnet build -c Release -warnaserror /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true
dotnet build -c Release -warnaserror /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true /p:NuGetAudit=false
- name: Unit Tests
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ jobs:
with:
dotnet-version: '8.0.x'
- name: Build
# We disable NuGet audit warnings, see https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904.
# Security issues being discovered in NuGet packages we use can happen any time, and thus all our CI builds that
# treat warnings as errors could break anytime, without us changing the code. This prevents that. Treaing them as
# warnings and other better approaches don't work, see https://github.com/OrchardCMS/OrchardCore/pull/16317.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# We disable NuGet audit warnings, see https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904.
# Security issues being discovered in NuGet packages we use can happen any time, and thus all our CI builds that
# treat warnings as errors could break anytime, without us changing the code. This prevents that. Treaing them as
# warnings and other better approaches don't work, see https://github.com/OrchardCMS/OrchardCore/pull/16317.
# We disable NuGet audit warnings, see https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904.
# Security issues being discovered in NuGet packages we use can happen at any time, and thus all our CI builds that
# treat warnings as errors that could break anytime, without us changing the code. This prevents that. Treating them as
# warnings and other better approaches don't work, see https://github.com/OrchardCMS/OrchardCore/pull/16317.

run: |
dotnet build -c Release -warnaserror /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true
dotnet build -c Release -warnaserror /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true /p:NuGetAudit=false
- name: Unit Tests
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/preview_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ jobs:
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 16368 ))" >> $GITHUB_ENV
- name: Build
if: steps.check-publish.outputs.should-publish == 'true'
# See pr_ci.yml for the reason why we disable NuGet audit warnings.
run: |
dotnet build -c Release -warnaserror /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true
dotnet build -c Release -warnaserror /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true /p:NuGetAudit=false
- name: Unit Tests
if: steps.check-publish.outputs.should-publish == 'true'
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 15471 ))" >> $GITHUB_ENV
- name: Build
# NuGetAudit is intentionally not disabled here like it is for other CI builds, because we need to address any
# vulnerable packages before releasing a new version.
run: |
dotnet build -c Release -warnaserror /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true -p:Version=${{ steps.get_version.outputs.VERSION }}
- name: Unit Tests
Expand Down