Skip to content

Commit 2e3765a

Browse files
committed
ci: don't fail-fast, add gdal
1 parent 149bc61 commit 2e3765a

File tree

3 files changed

+65
-18
lines changed

3 files changed

+65
-18
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,76 @@ on:
88

99
env:
1010
CARGO_TERM_COLOR: always
11+
CARGO_TERM_VERBOSE: true
1112

1213
jobs:
13-
test:
14+
windows:
15+
runs-on: windows-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: conda-incubator/setup-miniconda@v3
19+
- name: Set up Rust cache
20+
uses: Swatinem/rust-cache@v2
21+
- name: Test
22+
run: cargo test -F geo -F schemars -F reqwest --no-default-features
23+
macos:
24+
runs-on: macos-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: conda-incubator/setup-miniconda@v3
28+
- name: Set up Rust cache
29+
uses: Swatinem/rust-cache@v2
30+
- name: Install GDAL
31+
run: |
32+
brew update
33+
brew install gdal
34+
- name: Test
35+
run: cargo test --all-features
36+
without-gdal:
37+
runs-on: ubuntu-latest
1438
strategy:
15-
fail-fast: true
1639
matrix:
17-
os: [ubuntu-latest, macos-latest, windows-latest]
18-
runs-on: ${{ matrix.os }}
40+
args:
41+
- "-p stac"
42+
- "-p stac-api"
43+
- "-p stac-async"
44+
- "-p stac-validate"
45+
- "-p stac-cli --no-default-features"
46+
- "-p stac -F reqwest"
47+
- "-p stac -p stac-api -F geo"
48+
- "-p stac -p stac-api -F schemars"
1949
steps:
2050
- uses: actions/checkout@v4
2151
- name: Set up Rust cache
2252
uses: Swatinem/rust-cache@v2
23-
- name: Format
24-
run: cargo fmt --verbose
25-
- name: Build
26-
run: cargo build --verbose --all-features
2753
- name: Test
28-
run: cargo test --verbose --all-features
29-
test-stac:
54+
run: cargo test ${{ matrix.args }}
55+
with-gdal:
3056
runs-on: ubuntu-latest
3157
strategy:
32-
fail-fast: true
3358
matrix:
34-
flags: ["", "--features geo", "--features reqwest", "--features schemars"]
59+
args:
60+
- "-p stac -F gdal"
61+
- "-p stac-cli"
62+
- "--all-features"
3563
steps:
3664
- uses: actions/checkout@v4
3765
- name: Set up Rust cache
3866
uses: Swatinem/rust-cache@v2
39-
- name: Build
40-
run: cargo build --verbose -p stac ${{ matrix.flags }}
67+
- name: Install GDAL
68+
run: |
69+
sudo apt-get update
70+
sudo apt-get install libgdal-dev
4171
- name: Test
42-
run: cargo test --verbose -p stac ${{ matrix.flags }}
72+
run: cargo test ${{ matrix.args }}
73+
format:
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v4
77+
- name: Set up Rust cache
78+
uses: Swatinem/rust-cache@v2
79+
- name: Format
80+
run: cargo fmt --check
4381
doc:
4482
runs-on: ubuntu-latest
4583
env:
@@ -48,5 +86,9 @@ jobs:
4886
- uses: actions/checkout@v4
4987
- name: Set up Rust cache
5088
uses: Swatinem/rust-cache@v2
89+
- name: Install GDAL
90+
run: |
91+
sudo apt-get update
92+
sudo apt-get install libgdal-dev
5193
- name: Doc
5294
run: cargo doc --all-features

stac-cli/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ license = "MIT OR Apache-2.0"
1010
keywords = ["geospatial", "stac", "metadata", "geo", "raster"]
1111
categories = ["science", "data-structures"]
1212

13+
[features]
14+
default = ["gdal"]
15+
gdal = ["stac/gdal"]
16+
1317
[dependencies]
1418
clap = { version = "4", features = ["derive"] }
1519
console = "0.15"
@@ -18,7 +22,7 @@ indicatif = "0.17"
1822
reqwest = "0.12"
1923
serde = "1"
2024
serde_json = "1"
21-
stac = { version = "0.5", path = "../stac", features = ["gdal"] }
25+
stac = { version = "0.5", path = "../stac" }
2226
stac-api = { version = "0.3", path = "../stac-api" }
2327
stac-async = { version = "0.5", path = "../stac-async" }
2428
stac-validate = { version = "0.1", path = "../stac-validate" }

stac-cli/src/command.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::Result;
22
use clap::Subcommand;
3-
use stac::gdal::ItemBuilder;
43
use stac_api::GetSearch;
54

65
#[derive(Debug, Subcommand)]
76
pub enum Command {
87
/// Creates a STAC item.
8+
#[cfg(feature = "gdal")]
99
Create {
1010
/// The href of a raster data file.
1111
///
@@ -113,8 +113,9 @@ impl Command {
113113
pub async fn execute(self) -> Result<()> {
114114
use Command::*;
115115
match self {
116+
#[cfg(feature = "gdal")]
116117
Create { href, compact } => {
117-
let builder = ItemBuilder::new(&href)?;
118+
let builder = stac::gdal::ItemBuilder::new(&href)?;
118119
let item = builder.into_item()?;
119120
if compact {
120121
println!("{}", serde_json::to_string(&item)?);

0 commit comments

Comments
 (0)