name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libxkbcommon-dev \
libgl1-mesa-dev \
libwayland-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
pkg-config \
libnetcdf-dev \
cmake
- name: Clippy (Zarr-only)
run: cargo clippy --locked --all-targets --no-default-features --features dialog-portal -- -D warnings
- name: Clippy (SAFE, system NetCDF)
run: cargo clippy --locked --all-targets --features safe,dialog-portal -- -D warnings
- name: Test Zarr-only build
run: cargo test --locked --no-default-features --features dialog-portal
- name: Test SAFE with system NetCDF
run: cargo test --locked --features safe,dialog-portal
- name: Test SAFE with static NetCDF
run: cargo test --locked --no-default-features --features safe,dialog-portal,netcdf-static
- name: Verify crates.io package
run: cargo publish --dry-run --locked