-
Notifications
You must be signed in to change notification settings - Fork 16
77 lines (68 loc) · 1.84 KB
/
Copy pathci.yml
File metadata and controls
77 lines (68 loc) · 1.84 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
name: Format and Verify VOSTD (Main)
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
branch:
description: "Branch to run the workflow on"
required: true
default: "main"
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: |
set -o pipefail
if ! make 2>&1; then
echo "❌ Verification failed"
echo "VERIFY_FAILED=1" >> "$GITHUB_ENV"
exit 1
else
echo "✅ Verification passed!"
fi
- 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"