-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci[rust]: Improve Rust build/test workflows (#4817)
- Loading branch information
Showing
2 changed files
with
71 additions
and
72 deletions.
There are no files selected for viewing
116 changes: 71 additions & 45 deletions
116
.github/workflows/build-test.yaml → .github/workflows/build-test-rust.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,120 @@ | ||
name: Build and test rust | ||
name: Build and test Rust | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'polars/**' | ||
- '.github/workflows/build-test.yaml' | ||
- '.github/workflows/build-test-rust.yaml' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
examples: | ||
name: Examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
run: rustup update stable | ||
- uses: Swatinem/rust-cache@v1 | ||
- name: "check" | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Cache Rust | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run cargo check | ||
working-directory: examples | ||
run: cargo check | ||
|
||
features: | ||
name: Features | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2022-08-22 | ||
- uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Cache Rust | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
cargo install cargo-hack | ||
- name: Feature test | ||
run: cargo install cargo-hack | ||
|
||
- name: Run cargo hack | ||
working-directory: polars | ||
run: cargo hack check --each-feature --no-dev-deps --features private | ||
|
||
test-rust: | ||
name: Build and test Rust | ||
lint: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: polars | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2022-08-22 | ||
components: rustfmt, clippy, miri | ||
- name: Cache Cargo | ||
uses: actions/cache@v3 | ||
with: | ||
# these represent dependencies downloaded by cargo | ||
# and thus do not depend on the OS, arch nor rust version. | ||
path: /github/home/.cargo | ||
key: cargo-cache- | ||
- name: Cache Rust dependencies | ||
uses: actions/cache@v3 | ||
|
||
- name: Cache Rust | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
# these represent compiled steps of both dependencies and arrow | ||
# and thus are specific for a particular OS, arch and rust version. | ||
path: /github/home/target | ||
key: ubuntu-x86-64-target-cache-nightly | ||
- name: Install dependencies | ||
run: | | ||
rm -f dprint-x86_64-unknown-linux-gnu.zip | ||
- name: Run formatting checks | ||
run: | | ||
cargo fmt --all -- --check | ||
- name: Run linting checks | ||
workspaces: polars | ||
|
||
- name: Run rustfmt | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Run clippy | ||
env: | ||
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down | ||
working-directory: polars | ||
run : | | ||
cargo clippy --all-features \ | ||
-p polars-core \ | ||
-p polars-io \ | ||
-p polars-lazy \ | ||
-- -D warnings | ||
-p polars-core \ | ||
-p polars-io \ | ||
-p polars-lazy \ | ||
-- -D warnings | ||
cargo clippy -- -D warnings | ||
- name: Run tests | ||
env: | ||
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down | ||
working-directory: polars | ||
run: make test && make integration-tests | ||
- name: Run miri | ||
working-directory: polars | ||
run: | | ||
cargo miri setup | ||
cargo clean | ||
make miri | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
defaults: | ||
run: | ||
working-directory: polars | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2022-08-22 | ||
|
||
- name: Cache Rust | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: polars | ||
|
||
- name: Run tests | ||
env: | ||
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down | ||
run: make test | ||
|
||
- name: Run integration tests | ||
env: | ||
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down | ||
run: make integration-tests |
This file was deleted.
Oops, something went wrong.