-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (156 loc) · 5.91 KB
/
Copy pathci.yml
File metadata and controls
168 lines (156 loc) · 5.91 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
- name: Run tests
run: cargo test --all
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
with:
components: clippy
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
- name: Run clippy
run: cargo clippy -- -D warnings
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
llvm-check:
name: LLVM Feature Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
with:
components: clippy
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
- name: Install LLVM 18 and link dependencies
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | sudo tee /etc/apt/sources.list.d/llvm-18.list
sudo apt-get update
sudo apt-get install -y llvm-18-dev libzstd-dev libpolly-18-dev
- name: Clippy LLVM feature (zero warnings)
run: cargo clippy --features llvm --all-targets -- -D warnings
- name: Verify LLVM test targets compile
run: cargo test --features llvm --no-run
runtime-test:
name: Runtime Crate Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
- name: Run runtime tests
run: cd runtime && cargo test
forma-tests:
name: FORMA Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
- name: Build
run: cargo build --release
- name: Run .forma test files
run: |
PASS=0
FAIL=0
for f in tests/forma/*.forma; do
name=$(basename "$f")
if [ "$name" = "test_contract_errors.forma" ]; then
if ./target/release/forma run --allow-all "$f" > /dev/null 2>&1; then
echo "FAIL (unexpected pass): $name"
FAIL=$((FAIL + 1))
else
echo "XFAIL (expected contract violation): $name"
PASS=$((PASS + 1))
fi
continue
fi
if ./target/release/forma run --allow-all "$f" > /dev/null 2>&1; then
echo "PASS: $name"
PASS=$((PASS + 1))
else
echo "FAIL: $name"
FAIL=$((FAIL + 1))
fi
done
echo ""
echo "Results: $PASS passed, $FAIL failed"
if [ "$FAIL" -gt 0 ]; then exit 1; fi
contract-tests:
name: Contract Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
- name: Build release binary
run: cargo build --release
- name: Run contract verification suite
run: bash scripts/test_contracts.sh
coverage-audit:
name: Builtin Coverage Audit
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Run coverage audit (enforce 70% threshold)
run: bash scripts/builtin_coverage.sh --enforce 70 | tee coverage-report.txt
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: builtin-coverage-report
path: coverage-report.txt
showcase:
name: Showcase Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
- name: Build
run: cargo build --release
- name: Run showcase examples
run: |
PASS=0
FAIL=0
for f in examples/showcase/*.forma; do
name=$(basename "$f")
if ./target/release/forma run --allow-all "$f" > /dev/null 2>&1; then
echo "PASS: $name"
PASS=$((PASS + 1))
else
echo "FAIL: $name"
FAIL=$((FAIL + 1))
fi
done
echo ""
echo "Results: $PASS passed, $FAIL failed"
if [ "$FAIL" -gt 0 ]; then exit 1; fi