@@ -21,7 +21,7 @@ permissions:
2121
2222jobs :
2323 test :
24- name : Build and test (matrix)
24+ name : Build and test (matrix, non-regtest )
2525 runs-on : ubuntu-latest
2626 services :
2727 postgres :
8888 cd crates/indexer
8989 SKIP_DOCKER=true ./scripts/init_db.sh
9090
91- - name : Run tests
92- run : cargo test --workspace --all-features --no-fail-fast --verbose
91+ - name : Run non-regtest workspace tests
92+ run : cargo test --workspace --all-features --exclude lending-contracts --no-fail-fast --verbose
93+
94+ - name : Run lending-contracts library tests
95+ run : cargo test -p lending-contracts --lib --all-features --verbose
9396
9497 - name : Check that queries are fresh
9598 run : cargo sqlx prepare --workspace --check -- --all-targets
99+
100+ contracts-regtest :
101+ name : Contracts regtest tests
102+ runs-on : ubuntu-latest
103+
104+ steps :
105+ - name : Checkout
106+ uses : actions/checkout@v4
107+
108+ - name : Setup Rust (stable)
109+ uses : actions-rust-lang/setup-rust-toolchain@v1
110+ with :
111+ toolchain : stable
112+
113+ - name : Cache cargo
114+ uses : Swatinem/rust-cache@v2
115+ with :
116+ cache-on-failure : true
117+
118+ - name : Setup regtest executables
119+ uses : ./.github/actions/setup-regtest-execs
120+
121+ - name : Test lending-contracts regtest integration tests
122+ run : cargo test -p lending-contracts --tests --all-features --no-fail-fast --verbose -- --test-threads=1
123+
124+ - name : Assert no leaked regtest nodes after contracts tests
125+ if : always()
126+ run : |
127+ set -euo pipefail
128+ leaks="$(ps -eo pid=,comm=,args= | awk '$2=="elementsd" || $2=="electrs" {print}')"
129+ if [ -n "$leaks" ]; then
130+ echo "Leaked regtest node processes after contracts regtest tests:"
131+ echo "$leaks"
132+ exit 1
133+ fi
0 commit comments