Skip to content

Commit 00a7002

Browse files
committed
ci(github): replace placeholder rust cicd with actual implementation using nox sessions
1 parent fe02eca commit 00a7002

File tree

2 files changed

+52
-108
lines changed

2 files changed

+52
-108
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,48 @@
11

2+
name: Lint Rust Code
3+
24
on:
35
pull_request:
46
paths:
5-
- crates/**
6-
- docs/source/src/rust/**
7-
- examples/**
8-
- py-polars/src/**
9-
- py-polars/Cargo.toml
10-
- Cargo.toml
11-
- .github/workflows/lint-rust.yml
7+
- "rust/**/*.rs"
8+
- "Cargo.toml"
9+
- "noxfile.py"
10+
- ".github/workflows/lint-rust.yml"
1211
push:
1312
branches:
1413
- main
1514
- master
1615
paths:
17-
- crates/**
18-
- docs/source/src/rust/**
19-
- examples/**
20-
- py-polars/src/**
21-
- py-polars/Cargo.toml
22-
- Cargo.toml
23-
- .github/workflows/lint-rust.yml
24-
25-
concurrency:
26-
group: ${{ github.workflow }}-${{ github.ref }}
27-
cancel-in-progress: true
16+
- "rust/**/*.rs"
17+
- "Cargo.toml"
18+
- "noxfile.py"
19+
- ".github/workflows/lint-rust.yml"
2820

29-
env:
30-
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
21+
workflow_dispatch:
3122

3223
jobs:
33-
clippy-nightly:
24+
lint-rust:
25+
name: Run Rust Linting Checks
3426
runs-on: ubuntu-latest
35-
steps:
36-
- uses: actions/checkout@v4
3727

38-
- name: Set up Rust
39-
run: rustup component add clippy
40-
41-
- name: Cache Rust
42-
uses: Swatinem/rust-cache@v2
43-
with:
44-
save-if: ${{ github.ref_name == 'main' }}
45-
46-
- name: Run cargo clippy with all features enabled
47-
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings -D clippy::dbg_macro
48-
49-
# Default feature set should compile on the stable toolchain
50-
clippy-stable:
51-
runs-on: ubuntu-latest
5228
steps:
53-
- uses: actions/checkout@v4
29+
- name: Checkout code
30+
uses: actions/checkout@v4
5431

5532
- name: Set up Rust
56-
run: rustup override set stable && rustup update
33+
run: |
34+
rustup component add rustfmt clippy
5735

58-
- name: Install clippy
59-
run: rustup component add clippy
36+
- name: Set up uv
37+
uses: astral-sh/setup-uv@v6
6038

61-
- name: Cache Rust
62-
uses: Swatinem/rust-cache@v2
39+
- name: Set up Python
40+
uses: actions/setup-python@v5
6341
with:
64-
save-if: ${{ github.ref_name == 'main' }}
65-
66-
- name: Run cargo clippy
67-
run: cargo clippy --all-targets --locked -- -D warnings -D clippy::dbg_macro
68-
69-
rustfmt:
70-
if: github.ref_name != 'main'
71-
runs-on: ubuntu-latest
72-
steps:
73-
- uses: actions/checkout@v4
74-
75-
- name: Set up Rust
76-
run: rustup component add rustfmt
77-
78-
- name: Run cargo fmt
79-
run: cargo fmt --all --check
80-
81-
miri:
82-
if: github.ref_name != 'main'
83-
runs-on: ubuntu-latest
84-
steps:
85-
- uses: actions/checkout@v4
86-
87-
- name: Set up Rust
88-
run: rustup component add miri
42+
python-version-file: ".github/workflows/.python-version"
8943

90-
- name: Set up miri
91-
run: cargo miri setup
44+
- name: Run Rust format check
45+
run: uvx nox -s format-rust
9246

93-
- name: Run miri
94-
env:
95-
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-disable-stacked-borrows
96-
POLARS_ALLOW_EXTENSION: '1'
97-
run: >
98-
cargo miri test
99-
--features object
100-
-p polars-core
101-
# -p polars-arrow
47+
- name: Run Rust lint check
48+
run: uvx nox -s lint-rust
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,49 @@
1-
name: Test Rust
1+
name: Test Rust Code
22

33
on:
44
pull_request:
55
paths:
6-
- crates/**
7-
- examples/**
8-
- Cargo.toml
9-
- .github/workflows/test-rust.yml
6+
- "rust/**/*.rs"
7+
- "Cargo.toml"
8+
- "noxfile.py"
9+
- ".github/workflows/test-rust.yml"
1010
push:
1111
branches:
1212
- main
1313
- master
1414
paths:
15-
- crates/**
16-
- examples/**
17-
- Cargo.toml
18-
- .github/workflows/test-rust.yml
15+
- "rust/**/*.rs"
16+
- "Cargo.toml"
17+
- "noxfile.py"
18+
- ".github/workflows/test-rust.yml"
1919

20-
concurrency:
21-
group: ${{ github.workflow }}-${{ github.ref }}
22-
cancel-in-progress: true
23-
24-
env:
25-
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
26-
RUST_BACKTRACE: 1
20+
workflow_dispatch:
2721

2822
jobs:
29-
test:
23+
test-rust:
24+
name: Run Rust Tests on ${{ matrix.os }}
3025
runs-on: ${{ matrix.os }}
3126
strategy:
32-
fail-fast: false
3327
matrix:
34-
os: [ubuntu-latest, windows-latest, macos-latest]
28+
include:
29+
- { os: "ubuntu-latest" }
30+
- { os: "macos-latest" }
31+
- { os: "windows-latest" }
3532

3633
steps:
37-
- uses: actions/checkout@v4
34+
- name: Checkout code
35+
uses: actions/checkout@v4
3836

3937
- name: Set up Rust
4038
run: rustup show
4139

42-
- name: Cache Rust
43-
uses: Swatinem/rust-cache@v2
44-
with:
45-
save-if: ${{ github.ref_name == 'main' }}
40+
- name: Set up uv
41+
uses: astral-sh/setup-uv@v6
4642

47-
- name: Compile tests
48-
run: cargo test --all-features --no-run
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version-file: ".github/workflows/.python-version"
4947

50-
- name: Run tests
51-
if: github.ref_name != 'main'
52-
run: cargo test --all-features
48+
- name: Run Rust tests
49+
run: uvx nox -s test-rust

0 commit comments

Comments
 (0)