Refactor python package: unify f32/f64 implementations & zero copy views where possible #539
Workflow file for this run
This file contains hidden or 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
name: Rust library & CLI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
release: | |
types: [ published ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check_format: | |
name: Run cargo fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check format | |
run: cargo fmt -- --check | |
build_workspace: | |
name: Check and build entire workspace | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Check (default members) | |
run: cargo check | |
- name: Check with examples | |
run: cargo check --examples | |
- name: Check workspace (including pySplashsurf) | |
run: cargo check --workspace --all-targets | |
- name: Build (excluding pySplashsurf) | |
run: cargo build | |
- name: Run tests | |
run: cargo test | |
build_release: | |
name: Build & test release mode | |
runs-on: ubuntu-latest | |
needs: build_workspace | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Build (release) | |
run: cargo build --release | |
- name: Test (release) | |
run: cargo test --release | |
build_lib_all_features: | |
name: Build splashsurf_lib with all features | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Build | |
run: | | |
cargo build --manifest-path="splashsurf_lib/Cargo.toml" --all-targets --all-features | |
- name: Run tests | |
run: | | |
cargo test --manifest-path="splashsurf_lib/Cargo.toml" --all-features | |
- name: Run tests release mode | |
run: | | |
cargo test --manifest-path="splashsurf_lib/Cargo.toml" --release --all-features | |
build_lib_no_default_features: | |
name: Build splashsurf_lib with no default features | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Build | |
run: | | |
cargo build --manifest-path="splashsurf_lib/Cargo.toml" --all-targets --no-default-features | |
- name: Run tests | |
run: | | |
cargo test --manifest-path="splashsurf_lib/Cargo.toml" --no-default-features | |
publish: | |
name: Publish to crates.io | |
runs-on: ubuntu-latest | |
if: ${{ (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }} | |
needs: [check_format, build_workspace, build_lib_all_features, build_lib_no_default_features] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Publish splashsurf_lib | |
run: | | |
cargo publish --package splashsurf_lib | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
- name: Publish splashsurf | |
run: | | |
cargo publish --package splashsurf | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |