name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Format
run: cargo fmt --all -- --check
- name: Version strings match Cargo.toml
run: |
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
minor=${version%.*}
if grep -rn 'winds-engine = "' site/index.html | grep -vF "\"$minor\""; then
echo "::error::stale winds-engine version reference (Cargo.toml is $version)"
exit 1
fi
grep -q "v$version" site/index.html || { echo "::error::site badge is not v$version"; exit 1; }
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test
- name: Test (grib)
run: cargo test --features grib
- name: Test (download)
run: cargo test --features download
- name: Test (tiff)
run: cargo test --features tiff
- name: Clippy (all features)
run: cargo clippy --all-targets --all-features -- -D warnings