-
Notifications
You must be signed in to change notification settings - Fork 16
85 lines (75 loc) · 2.18 KB
/
Copy pathci.yml
File metadata and controls
85 lines (75 loc) · 2.18 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
name: Format and Verify VOSTD (PhaseII)
on:
push:
branches:
- phaseII/verified
pull_request:
branches:
- phaseII/verified
workflow_dispatch:
inputs:
branch:
description: "Branch to run the workflow on"
required: true
default: "phaseII/verified"
jobs:
format-and-verify:
runs-on: ubuntu-24.04
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update -qq
sudo apt install -y build-essential unzip pkg-config libssl-dev llvm
- name: Run dv bootstrap
run: cargo dv bootstrap
- name: Run verification
run: |
make 2>&1 | tee verus.log
if grep -q "error:" verus.log; then
echo "::error title=Verification Failed::Verification errors found in the code"
echo "Verification errors:"
grep "error:" verus.log | while read line; do
echo "::error::$line"
done
echo "VERIFY_FAILED=1" >> "$GITHUB_ENV"
exit 1
else
echo "✅ Verification passed!"
fi
- name: Cleanup verus.log
if: always()
run: rm -f verus.log
- name: Run format
if: always()
run: make fmt
- name: Check for formatting changes
if: always()
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Code is not properly formatted. Run 'make fmt'."
git diff
echo "FMT_FAILED=1" >> "$GITHUB_ENV"
# exit 1
fi
- name: Publish summary
if: always()
run: |
{
echo "# CI Summary"
if [[ "${FMT_FAILED:-0}" == "1" ]]; then
echo "- Formatting: ❌ failed"
else
echo "- Formatting: ✅ passed"
fi
if [[ "${VERIFY_FAILED:-0}" == "1" ]]; then
echo "- Verification: ❌ failed"
else
echo "- Verification: ✅ passed"
fi
} >> "$GITHUB_STEP_SUMMARY"