forked from pola-rs/polars
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (82 loc) · 2.37 KB
/
lint-rust.yml
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
name: Lint Rust
on:
pull_request:
paths:
- crates/**
- docs/src/rust/**
- examples/**
- py-polars/src/**
- py-polars/Cargo.toml
- Cargo.toml
- .github/workflows/lint-rust.yml
push:
branches:
- main
paths:
- crates/**
- docs/src/rust/**
- examples/**
- py-polars/src/**
- py-polars/Cargo.toml
- Cargo.toml
- .github/workflows/lint-rust.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
jobs:
clippy-nightly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup component add clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'main' }}
- name: Run cargo clippy with all features enabled
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings -D clippy::dbg_macro
# Default feature set should compile on the stable toolchain
clippy-stable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup override set stable && rustup update
- name: Install clippy
run: rustup component add clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'main' }}
- name: Run cargo clippy
run: cargo clippy --all-targets --locked -- -D warnings -D clippy::dbg_macro
rustfmt:
if: github.ref_name != 'main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup component add rustfmt
- name: Run cargo fmt
run: cargo fmt --all --check
miri:
if: github.ref_name != 'main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup component add miri
- name: Set up miri
run: cargo miri setup
- name: Run miri
env:
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-disable-stacked-borrows
POLARS_ALLOW_EXTENSION: '1'
run: >
cargo miri test
--features object
-p polars-core
# -p polars-arrow