-
-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (142 loc) · 4.43 KB
/
ci.yml
File metadata and controls
161 lines (142 loc) · 4.43 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
rust-tools:
name: Build and test Rust tools
runs-on: ubuntu-latest
defaults:
run:
working-directory: tools
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: Install Rust
uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable
- name: Build pmpl-sign
run: |
if [ -d "pmpl-sign" ]; then
cd pmpl-sign
cargo build --release
fi
- name: Build pmpl-verify
run: |
if [ -d "pmpl-verify" ]; then
cd pmpl-verify
cargo build --release
fi
- name: Build pmpl-audit
run: |
if [ -d "pmpl-audit" ]; then
cd pmpl-audit
cargo build --release
fi
- name: Run tests (if any)
run: |
if ls */Cargo.toml >/dev/null 2>&1; then
for crate in */Cargo.toml; do
dir=$(dirname "$crate")
(cd "$dir" && cargo test) || exit 1
done
fi
asciidoc:
name: Validate AsciiDoc docs
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: Install Asciidoctor
run: |
sudo apt-get update
sudo apt-get install -y asciidoctor
- name: Build key docs
run: |
find . -name '*.adoc' -maxdepth 2 -print0 | xargs -0 -n1 asciidoctor -o /dev/null
scm-validate:
name: Validate SCM manifests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: Check Scheme files parse
run: |
if command -v guile >/dev/null 2>&1; then
for f in *.scm; do
echo "Checking $f"
guile -c "(load \"$f\")" || exit 1
done
else
echo "Guile not installed; installing..."
sudo apt-get update
sudo apt-get install -y guile-3.0
for f in *.scm; do
echo "Checking $f"
guile -c "(load \"$f\")" || exit 1
done
fi
spdx-headers:
name: Check SPDX headers
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: Verify SPDX identifiers
run: |
set -e
echo "Checking for PMPL SPDX headers..."
# Example: check a few key directories; you can refine the patterns.
files=$(git ls-files '*.rs' '*.ex' '*.exs' '*.adoc' '*.scm' || true)
missing=0
for f in $files; do
if ! grep -q "SPDX-License-Identifier: PMPL-1.0-or-later" "$f"; then
echo "Missing SPDX header in: $f"
missing=1
fi
done
if [ "$missing" -ne 0 ]; then
echo "Some files are missing SPDX headers."
exit 1
fi
fuzz:
name: Fuzzing (cargo-fuzz, if present)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: Install Rust
uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable
- name: Install cargo-fuzz
run: cargo install cargo-fuzz || true
- name: Run fuzz targets (if any)
run: |
if [ -d "tools" ]; then
cd tools
if find . -name 'fuzz' -type d | grep -q fuzz; then
for fuzz_dir in $(find . -name 'fuzz' -type d); do
echo "Running fuzz in $fuzz_dir"
cd "$fuzz_dir"
# Run briefly to satisfy tooling without blowing CI time
FUZZ_TARGETS=$(cargo fuzz list || true)
for t in $FUZZ_TARGETS; do
echo "Fuzzing target $t for a short run"
cargo fuzz run "$t" -- -max_total_time=30 || true
done
cd - >/dev/null
done
else
echo "No fuzz targets found; skipping."
fi
fi