-
Notifications
You must be signed in to change notification settings - Fork 0
feat(v10.2.1): CI/CD hardening, security audit & +40 tests (167 total) #43
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
Changes from all commits
870ea44
e47af8d
237a7b4
a15d0dc
d65fcd8
f67888b
632e56a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: ['**'] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
| DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
| DOTNET_NOLOGO: true | ||
| DOTNET_VERSION: '10.0.x' | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| name: Build & Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET ${{ env.DOTNET_VERSION }} | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
|
||
| - name: Cache NuGet packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.nuget/packages | ||
| key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/*.slnx') }} | ||
| restore-keys: nuget-${{ runner.os }}- | ||
|
|
||
| - name: Restore dependencies | ||
| run: dotnet restore CaeriusNet.slnx | ||
|
|
||
| - name: Build (Release) | ||
| run: | | ||
| dotnet build CaeriusNet.slnx \ | ||
| --configuration Release \ | ||
| --no-restore \ | ||
| -p:TreatWarningsAsErrors=true \ | ||
| -p:WarningLevel=4 | ||
|
|
||
| - name: Run tests with coverage | ||
| run: | | ||
| dotnet test CaeriusNet.slnx \ | ||
| --configuration Release \ | ||
| --no-restore \ | ||
| --no-build \ | ||
| --collect:"XPlat Code Coverage" \ | ||
| --results-directory ./coverage \ | ||
| --logger "trx;LogFileName=test-results.trx" \ | ||
| --logger "console;verbosity=normal" \ | ||
| -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura | ||
|
|
||
| - name: Upload coverage reports | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: coverage-reports | ||
| path: ./coverage/**/coverage.cobertura.xml | ||
| retention-days: 14 | ||
|
|
||
| - name: Upload test results | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: test-results | ||
| path: ./coverage/**/*.trx | ||
| retention-days: 14 | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| if: success() && secrets.CODECOV_TOKEN != '' | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| files: ./coverage/**/coverage.cobertura.xml | ||
| flags: unittests | ||
| name: caeriusnet-coverage | ||
|
Comment on lines
+77
to
+85
|
||
| fail_ci_if_error: false | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: CodeQL Security Analysis | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, 'feature/**'] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: '0 3 * * 1' # Monday 03:00 UTC | ||
|
|
||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| env: | ||
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
| DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
| DOTNET_NOLOGO: true | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: CodeQL Analysis β C# | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: [csharp] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| queries: security-extended | ||
| config: | | ||
| paths-ignore: | ||
| - Benchmark/** | ||
| - Exemples/** | ||
| - Documentations/** | ||
|
|
||
| - name: Setup .NET 10 | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '10.0.x' | ||
|
|
||
| - name: Restore dependencies | ||
| run: dotnet restore CaeriusNet.slnx | ||
|
|
||
| - name: Build for CodeQL | ||
| run: | | ||
| dotnet build CaeriusNet.slnx \ | ||
| --configuration Release \ | ||
| --no-restore | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
| with: | ||
| category: /language:${{ matrix.language }} | ||
| upload: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This passes
WarningLevel=9999into MSBuild/CSC, which can break the CI build for the same reason as in the project files (invalid/warnlevel). Change this to-p:WarningLevel=4(or remove the property override entirely if the csproj already enforces the desired setting).