-
Notifications
You must be signed in to change notification settings - Fork 6
add CodeQL security scanning and Dependabot #38
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
Open
PrinceOliver
wants to merge
17
commits into
main
Choose a base branch
from
ci-confirguration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1d8c518
Added CI configuration
PrinceOliver d5c1b16
Added CodeQL workflow
PrinceOliver 935bdce
add CodeQL security scanning and Dependabot
PrinceOliver e576dc0
Potential fix for pull request finding 'CodeQL / Workflow does not co…
PrinceOliver 1cf8fc5
Update the Setup Node.js + Install dependencies section in .github/wo…
PrinceOliver 33236a1
Merge branch 'ci-confirguration' of https://github.com/syncfusion/bla…
PrinceOliver fa01934
ci(cd): harden nuget-publish pipeline
PrinceOliver 4501eb9
Potential fix for pull request finding 'CodeQL / Workflow does not co…
PrinceOliver 8e958c8
Potential fix for pull request finding 'CodeQL / Workflow does not co…
PrinceOliver 6411b3d
ci(cd): improved ci.yml (resilient bUnit + proper failure propagation)
PrinceOliver 9e7d8c0
Merge branch 'ci-confirguration' of https://github.com/syncfusion/bla…
PrinceOliver 5471a78
ci(cd): Clean up the duplicate permissions key
PrinceOliver 2591fb9
ci(cd): Resolved missing .slnx file during build and restore in ci
PrinceOliver 9328cf6
Add TZ and LANG at the job level and add a small step before tests th…
PrinceOliver a314cd4
add automatic versioning from the git tag
PrinceOliver 790e401
Merge branch 'main' of https://github.com/syncfusion/blazor-toolkit i…
PrinceOliver ab2b531
Nuget package publish with exact version related changes included.
Indhumathy-Loganathan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| version: 2 | ||
| updates: | ||
| # NuGet packages (.NET) | ||
| - package-ecosystem: "nuget" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| open-pull-requests-limit: 10 | ||
| labels: | ||
| - "dependencies" | ||
| - "nuget" | ||
| commit-message: | ||
| prefix: "deps(nuget)" | ||
|
|
||
| # npm (gulp, Playwright, etc.) | ||
| - package-ecosystem: "npm" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - "dependencies" | ||
| - "npm" | ||
| commit-message: | ||
| prefix: "deps(npm)" | ||
|
|
||
| # GitHub Actions | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - "dependencies" | ||
| - "github-actions" | ||
| commit-message: | ||
| prefix: "deps(actions)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,261 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| DOTNET_NOLOGO: true | ||
| DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
|
|
||
| jobs: | ||
| # ========================================================= | ||
| # Job 1: bUnit (matrix) | ||
| # ========================================================= | ||
| bunit: | ||
| name: bUnit (.NET ${{ matrix.dotnet-version }}) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
|
|
||
| env: | ||
| TZ: UTC | ||
| LANG: en_US.UTF-8 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| dotnet-version: ['8.0.x', '9.0.x', '10.0.x'] | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET ${{ matrix.dotnet-version }} | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: ${{ matrix.dotnet-version }} | ||
|
|
||
| - name: Cache NuGet packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.nuget/packages | ||
| key: nuget-${{ runner.os }}-${{ matrix.dotnet-version }}-${{ hashFiles('**/*.*proj') }} | ||
| restore-keys: | | ||
| nuget-${{ runner.os }}-${{ matrix.dotnet-version }}- | ||
| nuget-${{ runner.os }}- | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Cache npm | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.npm | ||
| key: npm-${{ runner.os }}-${{ hashFiles('**/package.json') }} | ||
| restore-keys: npm-${{ runner.os }}- | ||
|
|
||
| - name: Install npm dependencies | ||
| run: | | ||
| if [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then | ||
| npm ci | ||
| else | ||
| npm install --no-fund --no-audit | ||
| fi | ||
|
|
||
| - name: Restore | ||
| run: dotnet restore src/Syncfusion.Blazor.Toolkit.csproj | ||
|
|
||
| - name: Build | ||
| run: dotnet build src/Syncfusion.Blazor.Toolkit.csproj -c Release --no-restore | ||
|
|
||
| - name: Set timezone and locale for deterministic tests | ||
| run: | | ||
| sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y locales | ||
| sudo locale-gen en_US.UTF-8 | ||
| export LANG=en_US.UTF-8 | ||
| export TZ=UTC | ||
| shell: bash | ||
|
|
||
| - name: Run bUnit tests | ||
| run: | | ||
| mkdir -p TestResults | ||
| dotnet test tests/Syncfusion.Blazor.Toolkit.BUnitTest/ \ | ||
| -c Release \ | ||
| -f net8.0 \ | ||
| --logger "trx;LogFileName=bunit-${{ matrix.dotnet-version }}.trx" \ | ||
| --logger "html;LogFileName=bunit-${{ matrix.dotnet-version }}.html" \ | ||
| --results-directory TestResults \ | ||
| --collect:"XPlat Code Coverage" \ | ||
| --verbosity normal | ||
|
|
||
| - name: Upload bUnit results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: bunit-results-${{ matrix.dotnet-version }} | ||
| path: | | ||
| TestResults/ | ||
| **/coverage.cobertura.xml | ||
| retention-days: 14 | ||
| if-no-files-found: ignore | ||
|
|
||
| - name: Publish bUnit test results | ||
| if: always() | ||
| uses: dorny/test-reporter@v1 | ||
| continue-on-error: true | ||
| with: | ||
| name: bUnit (.NET ${{ matrix.dotnet-version }}) | ||
| path: 'TestResults/**/*.trx' | ||
| reporter: dotnet-trx | ||
| fail-on-error: false | ||
| fail-on-empty: false | ||
|
|
||
| # ========================================================= | ||
| # Job 2: Playwright | ||
| # ========================================================= | ||
| playwright: | ||
| name: Playwright | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 35 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: | | ||
| 8.x | ||
| 9.x | ||
| 10.x | ||
|
|
||
| - name: Cache NuGet packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.nuget/packages | ||
| key: nuget-${{ runner.os }}-${{ hashFiles('**/*.*proj') }} | ||
| restore-keys: nuget-${{ runner.os }}- | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Cache npm | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.npm | ||
| key: npm-${{ runner.os }}-${{ hashFiles('**/package.json') }} | ||
| restore-keys: npm-${{ runner.os }}- | ||
|
|
||
| - name: Install npm dependencies | ||
| run: | | ||
| if [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then | ||
| npm ci | ||
| else | ||
| npm install --no-fund --no-audit | ||
| fi | ||
|
|
||
| - name: Cache Playwright browsers | ||
| uses: actions/cache@v4 | ||
| id: playwright-cache | ||
| with: | ||
| path: ~/.cache/ms-playwright | ||
| key: playwright-${{ runner.os }}-${{ hashFiles('**/package.json') }} | ||
|
|
||
| - name: Install Playwright browsers | ||
| if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
| run: npx playwright install --with-deps chromium | ||
|
|
||
| - name: Install Playwright system deps | ||
| if: steps.playwright-cache.outputs.cache-hit == 'true' | ||
| run: npx playwright install-deps chromium | ||
|
|
||
| - name: Restore | ||
| run: dotnet restore src/Syncfusion.Blazor.Toolkit.csproj | ||
|
|
||
| - name: Build | ||
| run: dotnet build src/Syncfusion.Blazor.Toolkit.csproj -c Release --no-restore | ||
|
|
||
| - name: Run Playwright tests | ||
| run: npx playwright test --reporter=html,line | ||
| env: | ||
| CI: true | ||
|
|
||
| - name: Upload Playwright report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: playwright-report | ||
| path: | | ||
| playwright-report/ | ||
| test-results/ | ||
| retention-days: 14 | ||
| if-no-files-found: ignore | ||
|
|
||
| # ========================================================= | ||
| # Job 3: Summary | ||
| # ========================================================= | ||
| summary: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| name: CI Summary | ||
| runs-on: ubuntu-latest | ||
| needs: [bunit, playwright] | ||
| if: always() | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Check results and fail if needed | ||
| run: | | ||
| echo "bUnit result: ${{ needs.bunit.result }}" | ||
| echo "Playwright result: ${{ needs.playwright.result }}" | ||
|
|
||
| if [[ "${{ needs.bunit.result }}" != "success" || "${{ needs.playwright.result }}" != "success" ]]; then | ||
| echo "One or more jobs failed → failing the workflow" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "All jobs succeeded" | ||
|
|
||
| - name: Post summary comment (PRs only) | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const bunitOk = '${{ needs.bunit.result }}' === 'success'; | ||
| const pwOk = '${{ needs.playwright.result }}' === 'success'; | ||
| const overall = bunitOk && pwOk ? '✅ All checks passed' : '❌ Some checks failed'; | ||
|
|
||
| const body = `### CI Summary | ||
|
|
||
| | Job | Status | | ||
| |-----|--------| | ||
| | **bUnit** (.NET 8 / 9 / 10) | ${bunitOk ? '✅ Passed' : '❌ Failed'} | | ||
| | **Playwright** | ${pwOk ? '✅ Passed' : '❌ Failed'} | | ||
|
|
||
| **Overall:** ${overall} | ||
| `; | ||
|
|
||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.