Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Setup CI job matrix to run cargo test #17

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,34 @@ on:
types: [ opened, reopened, synchronize ]
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

permissions:
contents: read

jobs:
rust:
runs-on: ubuntu-24.04
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Update Rust toolchain
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

linux:
runs-on: ubuntu-22.04
strategy:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "cog3pio"
crate-type = ["cdylib"]
crate-type = ["cdylib", "rlib"]

[dependencies]
bytes = "1.5.0"
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//!
//! use bytes::Bytes;
//! use cog3pio::io::geotiff::read_geotiff;
//! use ndarray::Array2;
//! use ndarray::Array3;
//! use object_store::path::Path;
//! use object_store::{parse_url, GetResult, ObjectStore};
//! use tokio;
Expand All @@ -38,9 +38,9 @@
//! Cursor::new(bytes)
//! };
//!
//! let arr: Array2<f32> = read_geotiff(stream).unwrap();
//! assert_eq!(arr.dim(), (549, 549));
//! assert_eq!(arr[[500, 500]], 0.13482364);
//! let arr: Array3<f32> = read_geotiff(stream).unwrap();
//! assert_eq!(arr.dim(), (1, 549, 549));
//! assert_eq!(arr[[0, 500, 500]], 0.13482364);
//! }
//! ```

Expand Down