Skip to content

Commit 0c9ed6b

Browse files
committed
Add CI workflow and VSCode settings for spell checking
Signed-off-by: Ihor Dvoretskyi <[email protected]>
1 parent dee2296 commit 0c9ed6b

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

.github/workflows/ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
devcontainer-test:
11+
runs-on: ubuntu-latest
12+
name: Test Devcontainer Build
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Build and test devcontainer
18+
uses: devcontainers/[email protected]
19+
with:
20+
imageName: ghcr.io/idvoretskyi/dev
21+
runCmd: |
22+
# Test basic tools are available
23+
which docker
24+
which kubectl
25+
which helm
26+
which gh
27+
which node
28+
which npm
29+
# Test SSH server setup
30+
ls -la /run/sshd
31+
# Test essential packages
32+
curl --version
33+
jq --version
34+
35+
security-scan:
36+
runs-on: ubuntu-latest
37+
name: Security and SBOM Analysis
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Build Docker image for scanning
43+
run: |
44+
docker build -t dev-template:latest .devcontainer/
45+
46+
- name: Run Trivy vulnerability scanner
47+
uses: aquasecurity/trivy-action@master
48+
with:
49+
image-ref: 'dev-template:latest'
50+
format: 'sarif'
51+
output: 'trivy-results.sarif'
52+
53+
- name: Upload Trivy scan results to GitHub Security tab
54+
uses: github/codeql-action/upload-sarif@v3
55+
if: always()
56+
with:
57+
sarif_file: 'trivy-results.sarif'
58+
59+
- name: Generate SBOM
60+
uses: anchore/sbom-action@v0
61+
with:
62+
image: 'dev-template:latest'
63+
format: 'spdx-json'
64+
output-file: 'sbom.spdx.json'
65+
66+
- name: Upload SBOM as artifact
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: sbom
70+
path: sbom.spdx.json
71+
72+
lint-and-validate:
73+
runs-on: ubuntu-latest
74+
name: Lint and Validate Configuration
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
79+
- name: Validate devcontainer.json
80+
uses: devcontainers/[email protected]
81+
with:
82+
runCmd: devcontainer read-configuration --workspace-folder .
83+
84+
- name: Lint Dockerfile
85+
uses: hadolint/[email protected]
86+
with:
87+
dockerfile: .devcontainer/Dockerfile
88+
89+
- name: Validate docker-compose.yml
90+
run: |
91+
docker-compose -f .devcontainer/docker-compose.yml config
92+
93+
- name: Check for secrets
94+
uses: gitleaks/gitleaks-action@v2
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"cSpell.words": [
3+
"devcontainers",
4+
"idvoretskyi",
5+
"sarif"
6+
]
7+
}

0 commit comments

Comments
 (0)