Skip to content

Commit 8781809

Browse files
committed
ci: add Trivy, Gitleaks, and cross-platform unit tests
Add Trivy filesystem scan and Gitleaks secret detection to the security workflow using the self-hosted runner where both tools are natively installed. Docker is not required for Trivy fs mode. Add a cross-platform unit test matrix (ubuntu-latest, windows-latest) to CI. Unit tests use node:test with no VS Code dependency, so they run on any platform. The existing self-hosted macOS job remains as the baseline. Closes #44 Closes #25 Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent c96998b commit 8781809

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,29 @@ jobs:
3636
- name: Run tests
3737
run: npm test
3838

39+
unit-test-cross-platform:
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
os: [ubuntu-latest, windows-latest]
44+
runs-on: ${{ matrix.os }}
45+
timeout-minutes: 10
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v6
49+
50+
- name: Setup Node.js
51+
uses: actions/setup-node@v6
52+
with:
53+
node-version-file: .nvmrc
54+
cache: npm
55+
56+
- name: Install dependencies
57+
run: npm ci
58+
59+
- name: Run tests
60+
run: npm test
61+
3962
build:
4063
runs-on:
4164
- self-hosted

.github/workflows/security.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,44 @@ jobs:
3939

4040
- name: Audit production dependencies
4141
run: npm audit --audit-level=high --omit=dev
42+
43+
trivy:
44+
name: Trivy vulnerability scan
45+
runs-on:
46+
- self-hosted
47+
- macOS
48+
- ARM64
49+
- patchloom-vscode
50+
timeout-minutes: 10
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v6
54+
55+
- name: Setup Node.js
56+
uses: actions/setup-node@v6
57+
with:
58+
node-version-file: .nvmrc
59+
cache: npm
60+
61+
- name: Install dependencies
62+
run: npm ci
63+
64+
- name: Run Trivy filesystem scan
65+
run: trivy fs --scanners vuln,misconfig --severity HIGH,CRITICAL --exit-code 1 .
66+
67+
gitleaks:
68+
name: Gitleaks secret detection
69+
runs-on:
70+
- self-hosted
71+
- macOS
72+
- ARM64
73+
- patchloom-vscode
74+
timeout-minutes: 5
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v6
78+
with:
79+
fetch-depth: 0
80+
81+
- name: Run Gitleaks
82+
run: gitleaks detect --source . --verbose

0 commit comments

Comments
 (0)