-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (97 loc) · 3.21 KB
/
test.yml
File metadata and controls
110 lines (97 loc) · 3.21 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Protocols Tests
on:
push:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
env:
CARGO_TERM_COLOR: always
jobs:
tests:
name: Unit Tests
runs-on: ubuntu-24.04
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- name: Update Rust to ${{ matrix.toolchain }}
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-test-environment
- name: Build
run: cargo build --verbose
- name: Run unit tests (Debug)
run: cargo test --verbose
- name: Run Turnt tests for interpreter
run: turnt --env interp $(find . -type f -name '*.tx')
- name: Run Turnt tests for monitor
run: turnt --env monitor $(find . -type f -name '*.prot')
msrv:
name: Check Minimum Rust Version for protocols library
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-msrv
- name: Check MSRV
working-directory: protocols
run: cargo msrv verify
format:
name: Check Formatting
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- run: cargo fmt --check
clippy:
name: Clippy Lints
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
# Pin Rust version to prevent new Clippy lints from breaking CI
RUST_VERSION: "1.91.0"
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ env.RUST_VERSION }}
run: |
rustup toolchain install ${{ env.RUST_VERSION }} --component clippy
rustup default ${{ env.RUST_VERSION }}
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
python-checks:
name: Type-check, lint & format Python files
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-uv
- name: Use ty to typecheck python files
run: uv run --group dev ty check
- name: Use ruff to lint Python files
run: uv run --group dev ruff check
- name: Use ruff (via uv) to format Python files
# We pass in `--preview-features format` to suppress
# uv's warning messages about the formatter being experimental
run: uv format --check --preview-features format
benchmark:
name: Performance Benchmarks
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history to access baseline
- uses: ./.github/actions/setup-test-environment
- name: Install hyperfine
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.19.0/hyperfine_1.19.0_amd64.deb
sudo dpkg -i hyperfine_1.19.0_amd64.deb
- name: Build monitor (release)
run: cargo build --release --package protocols-monitor
- name: Run benchmarks
run: uv run scripts/benchmark_monitor.py
- name: Check for performance regressions
run: uv run scripts/check_performance_regression.py