From f82082da49ee86eff066e14dd2ba8b9bb7518912 Mon Sep 17 00:00:00 2001 From: Chris McKee Date: Thu, 6 Feb 2025 13:21:28 +0000 Subject: [PATCH 1/2] chore: actions are an endless chore --- .github/workflows/ci-build.yml | 13 +++++---- .../workflows/ci-manual-build-test-sign.yml | 2 +- .github/workflows/codeql-analysis.yml | 1 + .github/workflows/devskim.yml | 28 +++++++++++++++++++ .github/workflows/generate-publish-docs.yml | 1 + .github/workflows/markdown-link-check.yml | 4 +-- Directory.Packages.props | 12 ++++---- .../ConsoleApp/ExampleConsoleApp/Program.cs | 4 ++- src/BCrypt.Net/BCrypt.Net.csproj | 4 +-- tests/Directory.Build.props | 2 +- tests/UnitTests/BCrypt.Net.UnitTests.csproj | 6 +++- tests/UnitTests/BCryptTests.cs | 1 + tests/UnitTests/BCryptTestsExtendedv3.cs | 1 + tests/UnitTests/Base64Tests.cs | 1 + 14 files changed, 60 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/devskim.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index d3a2e6a..dba3fd2 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -42,9 +42,10 @@ jobs: uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0 with: dotnet-version: 9.0.x + cache: true - name: 'Restore external dependencies' - run: dotnet restore + run: dotnet restore --locked-mode - name: 'Build' id: build @@ -63,19 +64,19 @@ jobs: - name: 'Test' id: test - run: dotnet test --no-build --restore --collect:"XPlat Code Coverage" --logger junit + run: dotnet test --no-build --restore --collect:"XPlat Code Coverage" --logger junit tests/UnitTests/BCrypt.Net.UnitTests.csproj - name: 'Create test summary' uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 with: - paths: test/**/TestResults.xml + paths: tests/**/TestResults.xml show: "fail, skip" if: always() - name: 'Generate Coverage Reports' uses: danielpalme/ReportGenerator-GitHub-Action@c38c522d4b391c1b0da979cbb2e902c0a252a7dc # 5.4.3 with: - reports: "test/**/coverage.cobertura.xml" + reports: "tests/**/coverage.cobertura.xml" targetdir: "${{ github.workspace }}" reporttypes: "Cobertura" verbosity: "Info" @@ -110,11 +111,11 @@ jobs: uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0 if: always() with: - files: "test/**/TestResults.xml" + files: "tests/**/TestResults.xml" - name: Upload Test Artifacts uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: test-results - path: "test/**/TestResults.xml" + path: "tests/**/TestResults.xml" retention-days: 5 diff --git a/.github/workflows/ci-manual-build-test-sign.yml b/.github/workflows/ci-manual-build-test-sign.yml index 96380bb..7d1012a 100644 --- a/.github/workflows/ci-manual-build-test-sign.yml +++ b/.github/workflows/ci-manual-build-test-sign.yml @@ -52,7 +52,7 @@ jobs: run: dotnet build --configuration Release --property:PublicRelease=${{ inputs.public_release }} - name: 'Test' - run: dotnet test --configuration Release --no-restore --no-build --property:PublicRelease=${{ inputs.public_release }} + run: dotnet test --configuration Release --no-restore --no-build --property:PublicRelease=${{ inputs.public_release }} tests/UnitTests/BCrypt.Net.UnitTests.csproj - name: 'Pack release' run: dotnet pack --configuration Release --no-restore --no-build --output ${{ env.nupkgDirectory }} --property:PublicRelease=${{ inputs.public_release }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 573665c..13896d4 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -62,6 +62,7 @@ jobs: uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0 with: dotnet-version: 9.0.x + cache: true # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/devskim.yml b/.github/workflows/devskim.yml new file mode 100644 index 0000000..d5338b6 --- /dev/null +++ b/.github/workflows/devskim.yml @@ -0,0 +1,28 @@ +name: 'MSFT Dev Skim' + +on: + workflow_dispatch: + pull_request: + branches: + - 'main' + +permissions: + # required for all workflows + security-events: write + # only required for workflows in private repositories + actions: read + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-24.04 + steps: + - name: Harden Runner + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 + with: + egress-policy: audit + - uses: actions/checkout@v4 + - uses: microsoft/DevSkim-Action@v1 + - uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: devskim-results.sarif \ No newline at end of file diff --git a/.github/workflows/generate-publish-docs.yml b/.github/workflows/generate-publish-docs.yml index bb170d7..62841f5 100644 --- a/.github/workflows/generate-publish-docs.yml +++ b/.github/workflows/generate-publish-docs.yml @@ -38,6 +38,7 @@ jobs: uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0 with: dotnet-version: 9.0.x + cache: true - run: dotnet tool update -g docfx - run: docfx ./docs/docfx.json diff --git a/.github/workflows/markdown-link-check.yml b/.github/workflows/markdown-link-check.yml index be230fe..bb6671e 100644 --- a/.github/workflows/markdown-link-check.yml +++ b/.github/workflows/markdown-link-check.yml @@ -12,9 +12,9 @@ on: - main paths: - '**.md' - schedule: + #schedule: # Run every-day at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) - - cron: "0 9 * * *" + #- cron: "0 9 * * *" permissions: contents: read diff --git a/Directory.Packages.props b/Directory.Packages.props index e414248..67c92ba 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,16 +6,16 @@ + - - - - + + + - + - + diff --git a/examples/ConsoleApp/ExampleConsoleApp/Program.cs b/examples/ConsoleApp/ExampleConsoleApp/Program.cs index 664b8f6..b4023a9 100644 --- a/examples/ConsoleApp/ExampleConsoleApp/Program.cs +++ b/examples/ConsoleApp/ExampleConsoleApp/Program.cs @@ -1,4 +1,6 @@ -namespace ExampleConsoleApp; +using System; + +namespace ExampleConsoleApp; using BCryptNet; diff --git a/src/BCrypt.Net/BCrypt.Net.csproj b/src/BCrypt.Net/BCrypt.Net.csproj index 9e758e1..4204ba5 100644 --- a/src/BCrypt.Net/BCrypt.Net.csproj +++ b/src/BCrypt.Net/BCrypt.Net.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netstandard2.1;net9.0 - netstandard2.0;netstandard2.1;net462;net6.0;net8.0;net9.0 + netstandard2.0;netstandard2.1;net8.0;net9.0 + netstandard2.0;netstandard2.1;net462;net8.0;net9.0 BCrypt.Net-Next BCrypt.Net-Next diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index ce212ec..ccced02 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -25,6 +25,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/tests/UnitTests/BCrypt.Net.UnitTests.csproj b/tests/UnitTests/BCrypt.Net.UnitTests.csproj index 4a93412..f80933c 100644 --- a/tests/UnitTests/BCrypt.Net.UnitTests.csproj +++ b/tests/UnitTests/BCrypt.Net.UnitTests.csproj @@ -2,10 +2,14 @@ BCrypt.Net.UnitTests BCryptNet.UnitTests - net9.0 + net9.0 Debug default + true + Exe + true + Full $(DefineConstants);WINDOWS diff --git a/tests/UnitTests/BCryptTests.cs b/tests/UnitTests/BCryptTests.cs index 18d1c86..301fc1f 100644 --- a/tests/UnitTests/BCryptTests.cs +++ b/tests/UnitTests/BCryptTests.cs @@ -22,6 +22,7 @@ IN THE SOFTWARE. using System.Diagnostics.CodeAnalysis; using System.Security.Cryptography; using System.Text; +using Xunit; namespace BCryptNet.UnitTests { diff --git a/tests/UnitTests/BCryptTestsExtendedv3.cs b/tests/UnitTests/BCryptTestsExtendedv3.cs index 3ad2d77..6b6c467 100644 --- a/tests/UnitTests/BCryptTestsExtendedv3.cs +++ b/tests/UnitTests/BCryptTestsExtendedv3.cs @@ -22,6 +22,7 @@ IN THE SOFTWARE. using System.Diagnostics.CodeAnalysis; using System.Security.Cryptography; using System.Text; +using Xunit; namespace BCryptNet.UnitTests { diff --git a/tests/UnitTests/Base64Tests.cs b/tests/UnitTests/Base64Tests.cs index fc8974e..b320d68 100644 --- a/tests/UnitTests/Base64Tests.cs +++ b/tests/UnitTests/Base64Tests.cs @@ -19,6 +19,7 @@ using System; using System.Text; +using Xunit; namespace BCryptNet.UnitTests; From 1653cc37d7e1c1f0d52f7f24afad254d21a53859 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2025 00:00:53 +0000 Subject: [PATCH 2/2] Bump danielpalme/ReportGenerator-GitHub-Action from 5.4.3 to 5.4.4 Bumps [danielpalme/ReportGenerator-GitHub-Action](https://github.com/danielpalme/reportgenerator-github-action) from 5.4.3 to 5.4.4. - [Release notes](https://github.com/danielpalme/reportgenerator-github-action/releases) - [Commits](https://github.com/danielpalme/reportgenerator-github-action/compare/c38c522d4b391c1b0da979cbb2e902c0a252a7dc...f1927db1dbfc029b056583ee488832e939447fe6) --- updated-dependencies: - dependency-name: danielpalme/ReportGenerator-GitHub-Action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index dba3fd2..4542a70 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -74,7 +74,7 @@ jobs: if: always() - name: 'Generate Coverage Reports' - uses: danielpalme/ReportGenerator-GitHub-Action@c38c522d4b391c1b0da979cbb2e902c0a252a7dc # 5.4.3 + uses: danielpalme/ReportGenerator-GitHub-Action@f1927db1dbfc029b056583ee488832e939447fe6 # 5.4.4 with: reports: "tests/**/coverage.cobertura.xml" targetdir: "${{ github.workspace }}"