Skip to content

Commit

Permalink
Merge branch 'main' into quickbounds
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm authored Jan 5, 2025
2 parents f5ee746 + 009f876 commit e4eafd4
Show file tree
Hide file tree
Showing 234 changed files with 10,677 additions and 2,243 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ justfile
**/tests
demo/

####
#### This must match .gitignore ####
####

.DS_Store
target/
**/*.rs.bk
Expand All @@ -22,5 +25,13 @@ test_log*
pg_data/
config.yml
tests/output/
tests/mbtiles_temp_files/
tmp/
.aws-sam/

**/node_modules/
**/dist/

####
#### Above content must match .gitignore ####
####
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,27 @@ updates:
directory: "/"
schedule:
interval: "daily"
groups:
all-actions-version-updates:
applies-to: version-updates
patterns:
- "*"
all-actions-security-updates:
applies-to: security-updates
patterns:
- "*"
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
time: "02:00"
open-pull-requests-limit: 10
groups:
all-cargo-version-updates:
applies-to: version-updates
patterns:
- "*"
all-cargo-security-updates:
applies-to: security-updates
patterns:
- "*"
1 change: 1 addition & 0 deletions .github/files/multi-platform.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ ARG TARGETPLATFORM
LABEL org.opencontainers.image.description="Blazing fast and lightweight tile server with PostGIS, MBTiles, and PMTiles support"
COPY target_releases/$TARGETPLATFORM/* /usr/local/bin

HEALTHCHECK CMD wget --spider http://localhost:3000/health || exit 1
ENTRYPOINT ["/usr/local/bin/martin"]
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: 'Validate .md files (use "just fmt-md" to fix)'
uses: DavidAnson/markdownlint-cli2-action@v16
uses: DavidAnson/markdownlint-cli2-action@v19
with:
config: '.github/files/config.markdownlint-cli2.jsonc'

Expand Down
73 changes: 38 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
- run: just clippy
- run: just check
- run: just check-doc
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
- name: Init database
run: tests/fixtures/initdb.sh
env:
Expand Down Expand Up @@ -140,19 +142,19 @@ jobs:
for target in "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl"; do
echo -e "\n----------------------------------------------"
echo "Building $target"
# See https://github.com/cross-rs/cross/issues/1526
# TODO: Remove this once a version after cross 0.2.5 is released
export CROSS_BUILD_OPTS="--output=type=docker"
export "CARGO_TARGET_$(echo $target | tr 'a-z-' 'A-Z_')_RUSTFLAGS"='-C strip=debuginfo'
cross build --release --target $target --package mbtiles
cross build --release --target $target --package martin
cross build --release --target $target --workspace
mkdir -p target_releases/$target
mv target/$target/release/martin target_releases/$target
mv target/$target/release/martin-cp target_releases/$target
mv target/$target/release/mbtiles target_releases/$target
done
- name: Save build artifacts to build-${{ matrix.target }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cross-build
path: target_releases/*
Expand All @@ -169,7 +171,7 @@ jobs:
- name: Copy static files
run: cp -r tests/fixtures/pmtiles2/* ${{ steps.nginx.outputs.html-dir }}
- name: Build linux/arm64 Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
# https://github.com/docker/build-push-action
with:
context: .
Expand All @@ -191,7 +193,7 @@ jobs:
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=require

- name: Build linux/amd64 Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
# https://github.com/docker/build-push-action
with:
context: .
Expand Down Expand Up @@ -228,7 +230,7 @@ jobs:
images: ghcr.io/${{ github.repository }}
- name: Push the Docker image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: .github/files/multi-platform.Dockerfile
Expand All @@ -245,7 +247,7 @@ jobs:
matrix:
include:
- target: aarch64-apple-darwin
os: macos-14 # M1 CPU
os: macos-latest # M-series CPU
- target: debian-x86_64
os: ubuntu-latest
- target: x86_64-apple-darwin
Expand Down Expand Up @@ -287,7 +289,7 @@ jobs:
mv target/${{ matrix.target }}/release/martin-cp${{ matrix.ext }} target_releases/
mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases/
- name: Save build artifacts to build-${{ matrix.target }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.target }}
path: target_releases/*
Expand All @@ -300,7 +302,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download build artifact cross-build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: cross-build
- run: tests/test-aws-lambda.sh
Expand All @@ -316,26 +318,25 @@ jobs:
fail-fast: true
matrix:
include:
- target: x86_64-apple-darwin
os: macos-13
# temporary disabled due to an issue with homebrew which is difficult to debug
# - target: x86_64-apple-darwin
# os: macos-13
- target: x86_64-pc-windows-msvc
os: windows-latest
ext: '.exe'
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Start NGINX
uses: nyurik/[email protected]
id: nginx
with: { port: '5412', output-unix-paths: 'yes' }
- name: Copy static files
run: cp -r tests/fixtures/pmtiles2/* ${{ steps.nginx.outputs.html-dir }}
- name: Install and run Postgis
uses: nyurik/action-setup-postgis@v2
id: pg
with: { username: 'test', password: 'test', database: 'test' }
- name: Start NGINX
uses: nyurik/[email protected]
id: nginx
with: { port: '5412', output-unix-paths: 'yes' }
- name: Checkout sources
uses: actions/checkout@v4
- name: Init database
run: |
echo "DATABASE_URL=${{ steps.pg.outputs.connection-uri }}"
Expand All @@ -344,8 +345,10 @@ jobs:
tests/fixtures/initdb.sh
env:
PGSERVICE: ${{ steps.pg.outputs.service-name }}
- name: Copy static files
run: cp -r tests/fixtures/pmtiles2/* ${{ steps.nginx.outputs.html-dir }}
- name: Download build artifact build-${{ matrix.target }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-${{ matrix.target }}
path: target/
Expand All @@ -366,7 +369,7 @@ jobs:
run: diff --brief --recursive --new-file tests/output tests/expected
- name: Download Debian package (Linux)
if: matrix.target == 'x86_64-unknown-linux-gnu'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-debian-x86_64
path: target/
Expand All @@ -383,7 +386,7 @@ jobs:
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
- name: Save test output (on error)
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: failed-test-output-${{ runner.os }}
path: |
Expand Down Expand Up @@ -466,7 +469,7 @@ jobs:
docker cp ${{ job.services.postgres.id }}:/etc/ssl/certs/ssl-cert-snakeoil.pem target/certs/server.crt
docker cp ${{ job.services.postgres.id }}:/etc/ssl/private/ssl-cert-snakeoil.key target/certs/server.key
- name: Download build artifact build-x86_64-unknown-linux-gnu
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-x86_64-unknown-linux-gnu
path: target_releases/
Expand All @@ -485,7 +488,7 @@ jobs:
env:
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=${{ matrix.sslmode }}
- name: Download Debian package
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-debian-x86_64
path: target_releases/
Expand Down Expand Up @@ -517,7 +520,7 @@ jobs:
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=${{ matrix.sslmode }}
- name: Save test output (on error)
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-output
path: |
Expand All @@ -533,34 +536,34 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download build artifact build-aarch64-apple-darwin
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-aarch64-apple-darwin
path: target/aarch64-apple-darwin
- name: Download build artifact build-x86_64-apple-darwin
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-x86_64-apple-darwin
path: target/x86_64-apple-darwin
- name: Download build artifact build-x86_64-unknown-linux-gnu
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-x86_64-unknown-linux-gnu
path: target/x86_64-unknown-linux-gnu

- name: Download cross-build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: cross-build
path: target/cross

- name: Download build artifact build-x86_64-pc-windows-msvc
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-x86_64-pc-windows-msvc
path: target/x86_64-pc-windows-msvc
- name: Download build artifact build-debian-x86_64
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-debian-x86_64
path: target/debian-x86_64
Expand Down Expand Up @@ -631,7 +634,7 @@ jobs:
EOF
- name: Save Homebrew Config
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: homebrew-config
path: target/homebrew_config.yaml
Expand Down Expand Up @@ -663,7 +666,7 @@ jobs:

- name: Create a PR for maplibre/homebrew-martin
if: startsWith(github.ref, 'refs/tags/')
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
# Create a personal access token
# Gen: https://github.com/settings/personal-access-tokens/new
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v4

- run: |
cd demo/frontend
docker-compose build
- uses: taiki-e/install-action@v2
with: { tool: just }
- run: cd demo && just build
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.1.0
uses: dependabot/fetch-metadata@v2.2.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve Dependabot PRs
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/grcov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ jobs:
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-05-24
override: true
toolchain: nightly-2024-10-01

- name: Cleanup GCDA files
run: rm -rf martin/target/debug/deps/*.gcda
Expand All @@ -70,9 +69,9 @@ jobs:
uses: actions-rs/[email protected]

- name: Codecov upload
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: ${{ steps.coverage.outputs.report }}
files: ${{ steps.coverage.outputs.report }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
####
#### This must match .dockerignore ####
####

.DS_Store
target/
**/*.rs.bk
Expand All @@ -10,5 +13,13 @@ test_log*
pg_data/
config.yml
tests/output/
tests/mbtiles_temp_files/
tmp/
.aws-sam/

**/node_modules/
**/dist/

####
#### Above content must match .dockerignore ####
####
23 changes: 23 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# Parser settings.
cff-version: 1.2.0
message: Please cite this crate using these information.

# Version information.
date-released: 2024-11-29
version: 4.5.21

# Project information.
abstract: Vector Tiles from Large Databases on the Fly
authors:
- alias: nyurik
family-names: Astrakhan
given-names: Yuri
- name: The maplibre Community
license:
- MIT
- Apache-2.0
repository-artifact: https://martin.maplibre.org
repository-code: https://github.com/maplibre/martin
title: Martin
url: https://martin.maplibre.org
Loading

0 comments on commit e4eafd4

Please sign in to comment.