-
-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (109 loc) · 4.07 KB
/
ci.yml
File metadata and controls
133 lines (109 loc) · 4.07 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
128
129
130
131
132
133
name: CI
on:
push:
branches: [main, dev, release/*, feature/*]
pull_request:
branches: [main, dev, release/*]
env:
CARGO_TERM_COLOR: always
jobs:
rust:
name: Rust ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.11'
- name: Set Python environment variables
shell: bash
run: |
echo "PYO3_PYTHON=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV
echo "PYTHON_SYS_EXECUTABLE=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV
- name: Debug Python environment
shell: bash
run: |
echo "=== Python location and architecture ==="
which python3
python3 --version
python3 -c 'import platform,sys; print("Architecture:", platform.machine(), "Executable:", sys.executable)'
echo "=== Python library info ==="
python3 -c 'import sysconfig; print("LIBDIR:", sysconfig.get_config_var("LIBDIR")); print("LDLIBRARY:", sysconfig.get_config_var("LDLIBRARY"))'
- name: Set macOS linker flags
if: runner.os == 'macOS'
shell: bash
run: echo "RUSTFLAGS=-C link-arg=-undefined -C link-arg=dynamic_lookup" >> $GITHUB_ENV
- name: Set macOS linker flags
if: runner.os == 'macOS'
run: echo "RUSTFLAGS=-C link-arg=-undefined -C link-arg=dynamic_lookup" >> $GITHUB_ENV
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Build workspace
run: cargo build --workspace --all-features
- name: Run tests
run: cargo test --workspace --all-features
integration:
name: Integration Tests
runs-on: ubuntu-latest
needs: [rust]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.11'
- name: Set Python environment variables
shell: bash
run: |
echo "PYO3_PYTHON=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV
echo "PYTHON_SYS_EXECUTABLE=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV
- name: Debug Python environment
shell: bash
run: |
echo "=== Python location and architecture ==="
which python3
python3 --version
python3 -c 'import platform,sys; print("Architecture:", platform.machine(), "Executable:", sys.executable)'
echo "=== Python library info ==="
python3 -c 'import sysconfig; print("LIBDIR:", sysconfig.get_config_var("LIBDIR")); print("LDLIBRARY:", sysconfig.get_config_var("LDLIBRARY"))'
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run integration tests
run: cargo test --workspace --all-features --test '*'
- name: Run doc tests
run: cargo test --workspace --doc