-
-
Notifications
You must be signed in to change notification settings - Fork 3
129 lines (110 loc) · 3.86 KB
/
ci.yml
File metadata and controls
129 lines (110 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI/CD Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
# Basic validation tests
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate project structure
run: |
echo "Checking project structure..."
[ -f "README.md" ] || exit 1
[ -f "Makefile" ] || exit 1
[ -d "modules" ] || exit 1
[ -d "docker" ] || exit 1
echo "✓ Project structure is valid"
- name: Check for required files
run: |
echo "Checking required files..."
[ -f "LICENSE" ] || exit 1
[ -f "CONTRIBUTING.md" ] || exit 1
[ -f ".gitignore" ] || exit 1
echo "✓ Required files present"
- name: Validate markdown files
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: '.github/workflows/markdown-link-check-config.json'
# Build and test with Docker (CUDA)
test-cuda-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build CUDA Docker image
run: |
docker build -f docker/cuda/Dockerfile -t gpu-programming-101:cuda-ci .
- name: Test CUDA build system
run: |
docker run --rm -v $PWD:/workspace gpu-programming-101:cuda-ci bash -c "
cd /workspace &&
make check-cuda || echo 'CUDA not available in CI - expected' &&
echo 'Testing Makefile syntax...' &&
make -n module1 module2 module3 module4 module5
"
# Build and test with Docker (ROCm)
test-rocm-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build ROCm Docker image
run: |
docker build -f docker/rocm/Dockerfile -t gpu-programming-101:rocm-ci .
- name: Test ROCm build system
run: |
docker run --rm -v $PWD:/workspace gpu-programming-101:rocm-ci bash -c "
cd /workspace &&
make check-hip || echo 'HIP not available in CI - expected' &&
echo 'Testing Makefile syntax...' &&
make -n module1 module2 module3 module4 module5
"
# Test documentation
test-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check documentation completeness
run: |
echo "Checking module documentation..."
for i in {1..5}; do
[ -f "modules/module$i/README.md" ] || (echo "Missing README in module$i" && exit 1)
[ -f "modules/module$i/content.md" ] || (echo "Missing content.md in module$i" && exit 1)
echo "✓ Module $i documentation complete"
done
- name: Validate module structure
run: |
echo "Checking module structure..."
for i in {1..5}; do
[ -d "modules/module$i/examples" ] || (echo "Missing examples in module$i" && exit 1)
[ -f "modules/module$i/examples/Makefile" ] || (echo "Missing Makefile in module$i" && exit 1)
echo "✓ Module $i structure complete"
done
# Security scanning
security:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results.sarif'