Skip to content

Commit

Permalink
mbtiles: remove tls features, CI streamlining
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Sep 29, 2023
1 parent 06ec44a commit 3b59dab
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 182 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ jobs:
set -x
cargo fmt --all -- --check
cargo clippy --package martin-tile-utils -- -D warnings
cargo clippy --package martin-mbtiles --no-default-features -- -D warnings
cargo clippy --package martin-mbtiles -- -D warnings
cargo clippy --package martin-mbtiles --no-default-features --features native-tls -- -D warnings
cargo clippy --package martin-mbtiles --no-default-features --features rustls -- -D warnings
cargo clippy --package martin -- -D warnings
cargo clippy --package martin --features vendored-openssl -- -D warnings
cargo clippy --package martin --features bless-tests -- -D warnings
Expand All @@ -73,25 +72,25 @@ jobs:
- name: Build (native)
if: matrix.cross != 'true'
run: |
cargo build --release --target ${{ matrix.target }} --features=ssl --package martin
cargo build --release --target ${{ matrix.target }} --features=cli --package martin-mbtiles
cargo build --release --target ${{ matrix.target }} --package martin --features=ssl --package martin
cargo build --release --target ${{ matrix.target }} --package martin-mbtiles
- name: Build (cross - aarch64-apple-darwin)
if: matrix.target == 'aarch64-apple-darwin'
run: |
rustup target add "${{ matrix.target }}"
# compile without debug symbols because stripping them with `strip` does not work cross-platform
export RUSTFLAGS='-C link-arg=-s'
cargo build --release --target ${{ matrix.target }} --features=vendored-openssl --package martin
cargo build --release --target ${{ matrix.target }} --no-default-features --features=rustls,cli --package martin-mbtiles
cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl
cargo build --release --target ${{ matrix.target }} --package martin-mbtiles
- name: Build (cross - aarch64-unknown-linux-gnu)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
rustup target add "${{ matrix.target }}"
# compile without debug symbols because stripping them with `strip` does not work cross-platform
export RUSTFLAGS='-C link-arg=-s -C linker=aarch64-linux-gnu-gcc'
cargo build --release --target ${{ matrix.target }} --features=vendored-openssl --package martin
cargo build --release --target ${{ matrix.target }} --no-default-features --features=rustls,cli --package martin-mbtiles
cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl
cargo build --release --target ${{ matrix.target }} --package martin-mbtiles
- name: Build (debian package)
if: matrix.target == 'debian-x86_64'
run: |
Expand Down Expand Up @@ -152,10 +151,12 @@ jobs:
run: |
set -x
cargo test --package martin-tile-utils
cargo test --package martin-mbtiles --no-default-features
cargo test --package martin-mbtiles
cargo test --package martin-mbtiles --no-default-features --features rustls
cargo test --package martin
cargo test --package martin --features vendored-openssl
cargo test --doc
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace
cargo clean
env:
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
Expand Down Expand Up @@ -297,12 +298,7 @@ jobs:
echo "Same but as base64 to prevent GitHub obfuscation (this is not a secret):"
echo "$DATABASE_URL" | base64
set -x
cargo test --package martin-tile-utils
cargo test --package martin-mbtiles
cargo test --package martin-mbtiles --no-default-features --features rustls
cargo test --package martin --features vendored-openssl
cargo test --doc
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace
cargo test --package martin
cargo clean
env:
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=${{ matrix.sslmode }}
Expand Down
152 changes: 3 additions & 149 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ indoc = "2"
itertools = "0.11"
json-patch = "1.1"
log = "0.4"
martin-mbtiles = { path = "./martin-mbtiles", version = "0.4.0", default-features = false, features = ["native-tls"] } # disable CLI tools
martin-mbtiles = { path = "./martin-mbtiles", version = "0.5.0", default-features = false }
martin-tile-utils = { path = "./martin-tile-utils", version = "0.1.0" }
num_cpus = "1"
openssl = "0.10"
Expand All @@ -47,7 +47,7 @@ serde_json = "1"
serde_yaml = "0.9"
spreet = { version = "0.8", default-features = false }
sqlite-hashes = "0.3"
sqlx = { version = "0.7", features = ["sqlite"] }
sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio"] }
subst = { version = "0.3", features = ["yaml"] }
thiserror = "1"
tilejson = "0.3"
Expand Down
14 changes: 5 additions & 9 deletions martin-mbtiles/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "martin-mbtiles"
version = "0.4.0"
version = "0.5.0"
authors = ["Yuri Astrakhan <[email protected]>", "MapLibre contributors"]
description = "A simple low-level MbTiles access and processing library, with some tile format detection and other relevant heuristics."
keywords = ["mbtiles", "maps", "tiles", "mvt", "tilejson"]
Expand All @@ -10,19 +10,16 @@ repository.workspace = true
rust-version.workspace = true

[features]
# TODO: Disable "cli" feature in default builds
default = ["cli", "native-tls"]
cli = ["dep:anyhow", "dep:clap", "dep:env_logger", "dep:tokio"]
# One of the following two must be used
native-tls = ["sqlx/runtime-tokio-native-tls"]
rustls = ["sqlx/runtime-tokio-rustls"]
default = ["cli"]
cli = ["dep:anyhow", "dep:clap", "dep:env_logger", "dep:serde_yaml", "dep:tokio"]

[dependencies]
futures.workspace = true
log.workspace = true
martin-tile-utils.workspace = true
serde.workspace = true
serde_json.workspace = true
sqlite-hashes.workspace = true
sqlx.workspace = true
thiserror.workspace = true
tilejson.workspace = true
Expand All @@ -31,8 +28,7 @@ tilejson.workspace = true
anyhow = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
env_logger = { workspace = true, optional = true }
serde_yaml.workspace = true
sqlite-hashes.workspace = true
serde_yaml = { workspace = true, optional = true }
tokio = { workspace = true, features = ["rt-multi-thread"], optional = true }

[dev-dependencies]
Expand Down
Loading

0 comments on commit 3b59dab

Please sign in to comment.