-
Notifications
You must be signed in to change notification settings - Fork 305
72 lines (68 loc) · 2.36 KB
/
rust.yml
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
name: Rust CI
on: pull_request
jobs:
test:
name: Test Suite
runs-on: buildjet-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Load rust cache
uses: astriaorg/[email protected]
- name: Run cargo check, failing on warnings
run: cargo check --release --all-targets
env:
# The `-D warnings` option causes an error on warnings;
# we must duplicate the rustflags from `.cargo/config.toml`.
RUSTFLAGS: "-D warnings --cfg tokio_unstable"
# If a dependency was modified, Cargo.lock may flap if not committed.
- name: Check for diffs
shell: bash
run: |
s="$(git status --porcelain)"
if [[ -n "$s" ]]; then
echo "ERROR: found modified files that should be committed:"
echo "$s"
git diff | head -n 128
exit 1
else
echo "OK: no uncommitted changes detected"
fi
- name: Run tests with nextest
run: cargo nextest run --release --features migration
env:
CARGO_TERM_COLOR: always
fmt:
name: Rustfmt
runs-on: buildjet-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Load rust cache
uses: astriaorg/[email protected]
- run: cargo fmt --all -- --check
docs:
# We use a custom script to generate the index page for https://rustdoc.penumbra.zone,
# and refactors to rust deps can break that generation. Let's ensure this script exits 0
# on PRs, but we'll still only deploy after merge into main.
name: Check that rustdocs build OK
runs-on: buildjet-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Install rust toolchain
# The script for rustdoc build requires nightly toolchain.
uses: dtolnay/rust-toolchain@nightly
- name: Load rust cache
uses: astriaorg/[email protected]
- name: Build rustdocs
run: ./deployments/scripts/rust-docs