forked from bakeronchain/learnvault
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (28 loc) · 869 Bytes
/
Copy pathcontracts.yml
File metadata and controls
32 lines (28 loc) · 869 Bytes
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
name: Contract Tests
on:
pull_request:
branches:
- main
jobs:
contract-tests:
name: Contract Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup stable Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run contract tests
run: |
set -euo pipefail
# If the root Cargo.toml declares a workspace, run workspace tests.
if grep -qE '^\[workspace\]' Cargo.toml 2>/dev/null; then
echo "Cargo workspace detected; running 'cargo test --workspace'"
cargo test --workspace
else
echo "No workspace detected; running tests per contract"
for dir in contracts/*/; do
echo "==> Testing $dir"
(cd "$dir" && cargo test)
done
fi