Elffuss BraidHub

utopia-ia/elffuss-braid public

2dd40509e7e2 · 3.1 KiBRawPermalink
1name: CI
2
3on:
4 push:
5 branches: [main]
6 pull_request:
7
8permissions:
9 contents: read
10
11env:
12 CARGO_TERM_COLOR: always
13 RUSTFLAGS: -D warnings
14
15# The toolchain is pinned so that a new stable release, with new lints,
16# never breaks the build by surprise: bump it on purpose.
17jobs:
18 test:
19 name: test (${{ matrix.os }})
20 strategy:
21 fail-fast: false
22 matrix:
23 os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
24 runs-on: ${{ matrix.os }}
25 steps:
26 - uses: actions/checkout@v5
27 with:
28 # The git bridge round-trips this repository's own history, which a
29 # shallow checkout does not have.
30 fetch-depth: 0
31 - uses: dtolnay/rust-toolchain@1.99.0
32 with:
33 components: rustfmt, clippy
34 - uses: Swatinem/rust-cache@v2
35 - run: cargo fmt --all --check
36 - run: cargo clippy --workspace --all-targets --locked
37 - run: cargo test --workspace --locked
38
39 msrv:
40 name: minimum Rust version
41 runs-on: ubuntu-latest
42 steps:
43 - uses: actions/checkout@v5
44 - uses: dtolnay/rust-toolchain@1.89
45 - uses: Swatinem/rust-cache@v2
46 - run: cargo check --workspace --locked
47
48 wasm:
49 name: format and engine on WebAssembly
50 runs-on: ubuntu-latest
51 steps:
52 - uses: actions/checkout@v5
53 - uses: dtolnay/rust-toolchain@1.99.0
54 with:
55 targets: wasm32-unknown-unknown
56 - run: cargo check -p elffuss-braid-format -p elffuss-braid-engine --target wasm32-unknown-unknown --locked
57
58 deny:
59 name: licences and advisories
60 runs-on: ubuntu-latest
61 steps:
62 - uses: actions/checkout@v5
63 - uses: EmbarkStudios/cargo-deny-action@v2
64
65 bench:
66 name: benchmark smoke run
67 runs-on: ubuntu-latest
68 steps:
69 - uses: actions/checkout@v5
70 with:
71 # The quick import scenario reads this repository's own history.
72 fetch-depth: 0
73 - uses: dtolnay/rust-toolchain@1.99.0
74 - uses: Swatinem/rust-cache@v2
75 # Small inputs, only to keep the suite working: the ratios of a quick
76 # run mean nothing, and its results stay on the runner, unpublished.
77 - run: python3 bench/run.py --quick
78
79 privacy:
80 name: privacy check
81 runs-on: ubuntu-latest
82 steps:
83 - uses: actions/checkout@v5
84 with:
85 fetch-depth: 0
86 - run: scripts/privacy-check.sh
87
88 spec:
89 name: spec vectors (independent implementation)
90 runs-on: ubuntu-latest
91 steps:
92 - uses: actions/checkout@v5
93 - uses: dtolnay/rust-toolchain@1.99.0
94 - uses: Swatinem/rust-cache@v2
95 - run: cargo install b3sum --locked
96 - run: python3 docs/spec/check_vectors.py
97
98 fuzz:
99 name: fuzz smoke test
100 runs-on: ubuntu-latest
101 steps:
102 - uses: actions/checkout@v5
103 - uses: dtolnay/rust-toolchain@nightly
104 - uses: taiki-e/install-action@v2
105 with:
106 tool: cargo-fuzz
107 - name: run every target for one minute
108 working-directory: fuzz
109 run: |
110 for target in decode_tree decode_changeset names git_map git_objects; do
111 cargo fuzz run --target x86_64-unknown-linux-gnu "$target" -- -max_total_time=60
112 done