@@ -2,6 +2,9 @@ name: Basic checks
22
33on : [push]
44
5+ permissions :
6+ contents : read
7+
58jobs :
69 test :
710 runs-on : ubuntu-latest
1922 SNAPPY_LIB_DIR : /usr/lib/x86_64-linux-gnu
2023
2124 steps :
22- - uses : actions/checkout@v4
25+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+ with :
27+ persist-credentials : false
28+
2329 - name : Show system resource summary (before cleanup)
2430 run : |
2531 df -h
3541
3642 - name : Install dependencies on Ubuntu
3743 run : sudo apt-get update && sudo apt-get install -y protobuf-compiler librocksdb-dev
44+
3845 - name : Install formatting & linting tools
3946 run : rustup component add rustfmt clippy
4047
@@ -47,16 +54,44 @@ jobs:
4754 sed -i 's|.*"--cfg", .feature="tx_v6".*|# &|' .cargo/config.toml
4855 sed -i 's|.*"--cfg", "zcash_unstable=\\"nu7\\"".*|# &|' .cargo/config.toml
4956
50- - name : Run tests
57+ - name : Run non-network tests
58+ env :
59+ SKIP_NETWORK_TESTS : " 1"
5160 run : timeout --preserve-status 1h cargo test --verbose --locked
61+
62+ - name : Run network-sensitive tests
63+ run : |
64+ for attempt in 1 2 3; do
65+ echo "network-sensitive tests attempt ${attempt}"
66+
67+ timeout --preserve-status 45m bash -c '
68+ set -euo pipefail
69+ cargo test -p zebra-network --lib --verbose --locked -- --test-threads=1
70+ cargo test -p zebrad --test acceptance --verbose --locked -- --test-threads=1
71+ ' && exit 0
72+
73+ status=$?
74+ echo "network-sensitive tests attempt ${attempt} failed with status ${status}"
75+
76+ if [ "${attempt}" = "3" ]; then
77+ exit "${status}"
78+ fi
79+
80+ sleep 30
81+ done
82+
5283 - name : Run doc check
5384 run : cargo doc --workspace --no-deps --all-features --document-private-items --locked
85+
5486 - name : Run format check
5587 run : cargo fmt -- --check
88+
5689 - name : Run clippy
5790 run : cargo clippy --workspace --all-targets --features "default-release-binaries proptest-impl lightwalletd-grpc-tests zebra-checkpoints"
91+
5892 - name : Restore cargo config
5993 run : git checkout -- .cargo/config.toml
94+
6095 - name : Verify working directory is clean
6196 run : git diff --exit-code
6297
0 commit comments