-
-
Notifications
You must be signed in to change notification settings - Fork 0
219 lines (178 loc) · 6.12 KB
/
Copy pathci-extended.yml
File metadata and controls
219 lines (178 loc) · 6.12 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# SPDX-License-Identifier: MPL-2.0
permissions:
contents: read
name: CI Extended (RSR Compliance)
on:
push:
branches: [main, develop, claude/**]
pull_request:
branches: [main, develop]
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday
jobs:
rsr-compliance:
name: RSR Framework Verification
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v1
with:
deno-version: v1.x
- name: Check RSR Compliance
run: deno run --allow-read scripts/rsr-score.ts
- name: Verify Required Files
run: |
files=(
"SECURITY.md"
"CODE_OF_CONDUCT.md"
"MAINTAINERS.md"
".well-known/security.txt"
".well-known/ai.txt"
".well-known/humans.txt"
"PALIMPSEST-LICENSE.txt"
)
for file in "${files[@]}"; do
if [ ! -f "$file" ]; then
echo "❌ Missing required file: $file"
exit 1
else
echo "✅ Found: $file"
fi
done
test-matrix:
name: Test on ${{ matrix.os }} - Deno ${{ matrix.deno }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
deno: ['1.x', 'canary']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v1
with:
deno-version: ${{ matrix.deno }}
- name: Cache Dependencies
run: deno cache src/deps.ts
- name: Run Tests
run: deno test --allow-all
security-audit:
name: Security Audit
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v1
- name: Generate SBOM
run: |
deno info --json src/deps.ts > sbom.json
cat sbom.json
- name: Secret Scanning
uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SBOM
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sbom
path: sbom.json
offline-first-test:
name: Offline-First Verification
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v1
- name: Test Offline Mode
run: |
# Disable network
sudo iptables -I INPUT -j DROP
sudo iptables -I OUTPUT -j DROP
# Run offline tests
deno test --allow-all tests/offline.test.ts || true
# Re-enable network
sudo iptables -F
nix-build:
name: Nix Reproducible Build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Nix
uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build with Nix
run: nix build
- name: Run Nix Checks
run: nix flake check
documentation:
name: Build Documentation
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '20'
- name: Install TypeDoc
run: npm install -g typedoc
- name: Generate API Docs
run: typedoc
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/api
benchmark:
name: Performance Benchmarks
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v1
- name: Run Benchmarks
run: deno bench --allow-all benches/
slsa-provenance:
name: SLSA Provenance
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v1
- name: Build
run: deno run --allow-all build.ts
- name: Generate Provenance
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@f7dd8c54c2067bafc12ca7a55595d5ee9b75204a # v2.1.0
with:
artifacts: dist/
container-scan:
name: Container Security Scan
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Build Docker Image
run: docker build -t preference-injector:${{ github.sha }} .
- name: Run Trivy Scanner
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # master
with:
image-ref: preference-injector:${{ github.sha }}
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy Results
uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v3
with:
sarif_file: 'trivy-results.sarif'