-
Notifications
You must be signed in to change notification settings - Fork 108
140 lines (118 loc) · 4.53 KB
/
Copy pathverify-impl.yml
File metadata and controls
140 lines (118 loc) · 4.53 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
name: Verify (impl)
on:
workflow_call:
permissions:
contents: read
pull-requests: write
env:
MALACHITE_GIT_REF: "13bca14cd209d985c3adf101a02924acde8723a5"
# The default `info` log level is very noisy in CI test output; quiet it to errors only.
RUST_LOG: error
jobs:
test:
timeout-minutes: 20
runs-on:
- runs-on=${{ github.run_id }}
- runner=64cpu-linux-arm64
- volume=80gb
steps:
- name: Install Protoc
uses: taiki-e/install-action@v2
with:
tool: protoc
- uses: actions/checkout@v6
with:
repository: informalsystems/malachite
ref: ${{ env.MALACHITE_GIT_REF }}
path: ./malachite
- name: Install Rust 1.95.0
uses: dtolnay/rust-toolchain@1.100.0
with:
components: rustfmt, llvm-tools-preview
- uses: actions/setup-node@v6
with:
node-version: 22
- uses: actions/checkout@v6
with:
path: ./snapchain
fetch-depth: 0
# Cache cargo registry/git and the build target dir to speed up CI. Malachite is a path
# dependency; cargo fingerprints its source and rebuilds only the changed malachite crates
# on a ref bump, so no custom cache key is needed to keep artifacts correct.
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: ./snapchain
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- working-directory: ./snapchain
env:
RUSTFLAGS: "-Dwarnings -A mismatched_lifetime_syntaxes"
run: |
cargo llvm-cov --workspace --lcov --output-path lcov.info --ignore-filename-regex 'proto/'
cargo llvm-cov report --html --output-dir coverage --ignore-filename-regex 'proto/'
- name: Set up Python
if: github.event_name == 'pull_request'
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install diff-cover
if: github.event_name == 'pull_request'
run: pip install diff-cover==9.2.0
- name: Generate diff coverage report
if: github.event_name == 'pull_request'
working-directory: ./snapchain
run: |
diff-cover lcov.info \
--compare-branch=origin/${{ github.base_ref }} \
--markdown-report=diff-coverage.md \
--fail-under=0
- name: Post diff coverage comment
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v3
with:
header: coverage
path: ./snapchain/diff-coverage.md
- working-directory: ./snapchain
env:
RUSTFLAGS: "-Dwarnings -A mismatched_lifetime_syntaxes"
run: cargo check --bins
- working-directory: ./snapchain
env:
RUSTFLAGS: "-Dwarnings -A mismatched_lifetime_syntaxes"
run: cargo fmt --all --check
# The L0 conformance corpus is checked in and must be reproducible: regenerating it without a
# protocol change must produce no diff. A diff here means encoding/hash/signature/state-root
# output changed and the committed corpus (and the protocol-repo copy) needs regenerating.
- name: Check conformance corpus is up to date
working-directory: ./snapchain
env:
RUSTFLAGS: "-Dwarnings -A mismatched_lifetime_syntaxes"
run: |
cargo test --test conformance_test generate_corpus -- --ignored --nocapture
git diff --exit-code -- tests/conformance/corpus \
|| (echo "::error::Conformance corpus is stale. Run: cargo test --test conformance_test generate_corpus -- --ignored, then sync farcasterxyz/protocol/vectors/" && exit 1)
- working-directory: ./snapchain/tests/client_parity_tests
run: |
npx node-gyp@12.2.0 install
yarn install
- working-directory: ./snapchain/tests/client_parity_tests
run: yarn test
- name: Upload coverage report
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-report
path: ./snapchain/coverage/
retention-days: 14
# Publish the L0 conformance corpus as a portable artifact an external client can download
# and run against in its own CI.
- name: Upload conformance corpus
uses: actions/upload-artifact@v7
if: always()
with:
name: conformance-corpus
path: ./snapchain/tests/conformance/
retention-days: 14