-
Notifications
You must be signed in to change notification settings - Fork 8
127 lines (102 loc) · 3.28 KB
/
Copy pathrust.yml
File metadata and controls
127 lines (102 loc) · 3.28 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: cargo fmt
run: cargo fmt -- --check
- name: cargo clippy
run: cargo clippy -- -D warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Cache Python test venv
uses: actions/cache@v4
with:
path: tests/.test-venv
key: ${{ runner.os }}-test-venv-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-test-venv-
- name: Setup test environment
run: ./tests/setup_test_env.sh
- name: Build
run: cargo build --verbose
- name: Run tests
run: |
echo "Running all tests..."
cargo test --test integration_local_mode --verbose
cargo test --test integration_execution --verbose
cargo test --bins --verbose
echo "✅ All tests passed!"
# Connect-mode tests require a running Jupyter server and are not run in CI by default.
# To enable, set RUN_CONNECT_TESTS=true in the workflow environment and ensure
# jupyter_server + jupyter-server-documents are installed in the test venv.
# Note: must use --test-threads=1 to avoid races on the shared Jupyter server.
#
# - name: Run connect-mode tests
# if: env.RUN_CONNECT_TESTS == 'true'
# run: cargo test --test integration_connect_mode -- --test-threads=1
test-windows:
name: Test (Windows)
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust target
run: rustup target add x86_64-pc-windows-msvc
- name: Build release binary
run: cargo build --release --target x86_64-pc-windows-msvc
- name: Run unit tests (kernel discovery)
# Integration tests require a Unix shell setup script; run unit tests only.
# This verifies Windows-specific #[cfg(target_os = "windows")] code paths compile
# and that kernel directory logic is correct on Windows.
run: cargo test --bins --verbose
- name: Upload Windows binary
uses: actions/upload-artifact@v4
with:
name: nb-windows-amd64
path: target/x86_64-pc-windows-msvc/release/nb.exe
retention-days: 30