Skip to content

Commit cc0aa0f

Browse files
committed
ci: add Codecov, CodeQL, Dependabot and update README
1 parent 49e32db commit cc0aa0f

File tree

4 files changed

+81
-7
lines changed

4 files changed

+81
-7
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "nuget"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 5
8+
labels: ["dependencies"]
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
open-pull-requests-limit: 5
14+
labels: ["dependencies", "ci"]

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ jobs:
5858
name: test-results
5959
path: TestResults
6060

61+
- name: Upload coverage to Codecov
62+
uses: codecov/codecov-action@v4
63+
with:
64+
token: ${{ secrets.CODECOV_TOKEN }}
65+
files: coverage/lcov.info
66+
fail_ci_if_error: false
67+
verbose: false
68+
6169
lint-readme:
6270
runs-on: ubuntu-latest
6371
steps:

.github/workflows/codeql.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
schedule:
9+
- cron: '0 3 * * 1'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language: [ 'csharp' ]
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v3
29+
with:
30+
languages: ${{ matrix.language }}
31+
32+
- name: Setup .NET
33+
uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: 8.0.x
36+
37+
- name: Restore dependencies
38+
run: dotnet restore
39+
40+
- name: Build
41+
run: dotnet build --configuration Release --no-restore
42+
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@v3
45+
with:
46+
category: '/language:${{matrix.language}}'

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,19 +321,25 @@ Do not commit real credentials. Connection string is externalized. Recommended i
321321
- Enforce HTTPS and strict TLS settings
322322
- Add static code analysis (CodeQL)
323323

324-
## 🤖 CI/CD (Suggested)
324+
## 🤖 CI/CD (Implemented)
325325

326-
Workflow defined in `.github/workflows/ci.yml` executes on pushes and PRs to `main` or `master`:
326+
Workflow `.github/workflows/ci.yml` runs on pushes and PRs to `main` / `master`:
327327

328328
- Restore -> Build (Release) -> Test (with coverage collection)
329329
- Publishes test results & coverage (Cobertura + lcov) as artifacts
330-
- Separate job lints `README.md` using markdown-lint
330+
- Optional Codecov upload step (add `CODECOV_TOKEN` secret to enable)
331+
- Separate job lints `README.md`
331332

332-
You can extend by:
333+
Additional automation:
333334

334-
- Adding Codecov upload (needs CODECOV_TOKEN secret)
335-
- Enabling dependabot for NuGet & GitHub Actions
336-
- Adding security scanning (CodeQL workflow)
335+
- Code scanning via CodeQL (`.github/workflows/codeql.yml`)
336+
- Dependency updates via Dependabot (`.github/dependabot.yml`) for NuGet & GitHub Actions (daily)
337+
338+
Recommended next enhancements:
339+
340+
- Enforce status checks (tests, CodeQL) before merge
341+
- Add branch protection & required reviews
342+
- Gate plugin deployment with a manual approval job
337343

338344
## 🗺️ Roadmap (Ideas)
339345

0 commit comments

Comments
 (0)