-
Notifications
You must be signed in to change notification settings - Fork 11
93 lines (75 loc) · 2.42 KB
/
Copy pathtest.yml
File metadata and controls
93 lines (75 loc) · 2.42 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Run Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
name: Run All Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev
- name: Run cargo build
run: cargo build --all --verbose
- name: Run cargo test
run: cargo test --all --verbose
- name: Run OpenAPI consistency tests
run: cargo test -p basis_server --test openapi_consistency -- --nocapture
- name: Validate OpenAPI YAML syntax
run: python3 -c "import yaml; yaml.safe_load(open('openapi.yaml'))"
- name: Run cargo clippy
run: cargo clippy --all -- -D warnings
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run specific crate tests
run: |
cargo test -p basis_store -- --nocapture
cargo test -p basis_server -- --nocapture
cargo test -p basis_offchain -- --nocapture
cargo test -p basis_app -- --nocapture
- name: Run specific module tests
run: |
cargo test -p basis_store reserve_tracker::tests -- --nocapture
cargo test -p basis_store ergo_scanner::tests -- --nocapture
cargo test -p basis_store tests::test_module -- --nocapture
- name: Setup Scala
uses: coursier/setup-action@v1
with:
jvm: adopt:11
apps: sbt
- name: Run Scala reference tests
run: |
cd scala
sbt test
- name: Check build for all crates
run: |
cargo build -p basis_store
cargo build -p basis_server
cargo build -p basis_offchain
cargo build -p basis_app
cargo build -p basis_cli
- name: Check for warnings
run: |
# Fail if there are any warnings
cargo check --all --quiet 2>&1 | grep -v "unused import" | grep -v "never used" | grep -i "warning" && exit 1 || exit 0