Skip to content

Commit

Permalink
Merge branch 'main' into experiement-surface-android
Browse files Browse the repository at this point in the history
# Conflicts:
#	maplibre-winit/src/winit/mod.rs
#	maplibre/src/window.rs
  • Loading branch information
maxammann committed Jun 2, 2022
2 parents b550e39 + 8248d4b commit 707c193
Show file tree
Hide file tree
Showing 74 changed files with 2,177 additions and 1,699 deletions.
3 changes: 2 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ rustflags = [
# Enables the possibility to import memory into wasm.
# Without --shared-memory it is not possible to use shared WebAssembly.Memory.
"-C", "link-args=--shared-memory --import-memory",
]
]
runner = 'wasm-bindgen-test-runner'
6 changes: 6 additions & 0 deletions .github/actions/android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ runs:
- name: Build
shell: bash
run: just build-android
# TODO: Additional clippy checks for different targets
- name: Check x86_64
shell: bash
run: |
Expand All @@ -24,3 +25,8 @@ runs:
env "AR_aarch64-linux-android=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar" \
env "CC_aarch64-linux-android=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang" \
just check maplibre-android aarch64-linux-android
# FIXME: Requires cross-compilation
#- name: Test
# shell: bash
# # TODO: Additional test runs for different targets
# run: just test maplibre-android aarch64-linux-android
10 changes: 7 additions & 3 deletions .github/actions/apple/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ runs:
- name: Check x86_64 darwin
shell: bash
run: just check apple x86_64-apple-darwin
- name: Check aarch64 darwin
- name: Check x86_64 darwin
shell: bash
# TODO: Additional clippy checks for different targets (iOS)
run: just check apple x86_64-apple-darwin
- name: Test x86_64 darwin
shell: bash
run: just check apple aarch64-apple-darwin
# TODO: Additional clippy checks for iOS
# TODO: Additional test runs for different targets (Different targets might require emulation)
run: just test apple x86_64-apple-darwin
- name: Build Example
shell: bash
run: cd apple/xcode && xcodebuild -scheme "example (iOS)" -arch arm64 -sdk iphoneos build CODE_SIGNING_ALLOWED=NO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ runs:
- name: Check
shell: bash
run: just check maplibre-demo x86_64-unknown-linux-gnu
- name: Test x86_64 linux
shell: bash
run: just test maplibre-demo x86_64-unknown-linux-gnu
- uses: actions/upload-artifact@v2
with:
name: maplibre-rs
Expand Down
6 changes: 6 additions & 0 deletions .github/actions/demo/macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ runs:
- name: Build
shell: bash
run: cd apple/xcode && xcodebuild -scheme "example (macOS)" build CODE_SIGNING_ALLOWED=NO MACOSX_DEPLOYMENT_TARGET=10.9 -derivedDataPath build
- name: Check x86_64 darwin
shell: bash
run: just check maplibre-demo x86_64-apple-darwin
- name: Test x86_64 darwin
shell: bash
run: just test maplibre-demo x86_64-apple-darwin
- uses: actions/upload-artifact@v3
with:
name: maplibre-x86_64-apple-darwin-demo
Expand Down
35 changes: 35 additions & 0 deletions .github/actions/demo/windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: windows-demo
description: Build windows-demo for windows

runs:
using: "composite"
steps:
- uses: extractions/setup-just@v1
- name: Install toolchain
shell: bash
run: just default-toolchain
- uses: Swatinem/rust-cache@v1
- uses: ilammy/msvc-dev-cmd@v1 # Provide access to lib.exe
- name: Install SQLite
shell: powershell
run: choco install sqlite -y --params "/NoTools"
- name: Build SQLite lib
shell: powershell
run: |
cd "C:\ProgramData\chocolatey\lib\SQLite\tools"
lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x64
echo "SQLITE3_LIB_DIR=C:\ProgramData\chocolatey\lib\SQLite\tools" >> $env:GITHUB_ENV
- name: Build
shell: bash
run: cargo build -p maplibre-demo --release --target x86_64-pc-windows-msvc
- name: Check x86_64 windows
shell: bash
run: just check maplibre-demo x86_64-pc-windows-msvc
- name: Test x86_64 windows
shell: bash
run: just test maplibre-demo x86_64-pc-windows-msvc
- uses: actions/upload-artifact@v3
with:
name: maplibre-x86_64-windows-demo
path: target/x86_64-pc-windows-msvc/release/maplibre-demo.exe
if-no-files-found: error
18 changes: 18 additions & 0 deletions .github/actions/tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: tests
description: Run tests

runs:
using: "composite"
steps:
- uses: extractions/setup-just@v1
- name: Install toolchain
shell: bash
run: just default-toolchain
- uses: Swatinem/rust-cache@v1
- name: Install Dependencies
shell: bash
run: sudo apt-get install -y libwayland-dev libxkbcommon-dev # Required for winit
- name: Test
shell: bash
# TODO: Additional test runs for different targets
run: just test maplibre x86_64-unknown-linux-gnu
5 changes: 5 additions & 0 deletions .github/actions/webgl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ runs:
- name: Check
shell: bash
run: just check web wasm32-unknown-unknown
- name: Test
shell: bash
run: |
cargo install wasm-bindgen-cli --version "0.2.80"
just web-test "web-webgl"
7 changes: 6 additions & 1 deletion .github/actions/webgpu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ runs:
run: just web-demo build
- name: Check
shell: bash
run: just check web wasm32-unknown-unknown
run: just check web wasm32-unknown-unknown
- name: Test
shell: bash
run: |
cargo install wasm-bindgen-cli --version "0.2.80"
just web-test ""
19 changes: 15 additions & 4 deletions .github/workflows/on_main_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/benchmarks
build-linux-demo:
run-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/linux-demo
- uses: ./.github/actions/tests
build-android:
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -62,17 +62,28 @@ jobs:
source: docs/book/.
destination: docs
key: ${{ secrets.SSH_KEY_MAXAMMANN_ORG }}
build-ios:
build-apple:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/apple
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-demo-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/demo/linux
build-demo-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/demo/windows
build-demo-macos:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/demo/macos
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

18 changes: 14 additions & 4 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/benchmarks
build-linux-demo:
run-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/linux-demo
- uses: ./.github/actions/tests
build-android:
runs-on: ubuntu-20.04
steps:
Expand All @@ -42,17 +42,27 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/docs
build-ios:
build-apple:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/apple
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-demo-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/demo/linux
build-demo-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/demo/windows
build-demo-macos:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/demo/macos
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .idea/maplibre-rs.iml

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

19 changes: 19 additions & 0 deletions .idea/runConfigurations/Run_Tests.xml

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

14 changes: 10 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ set shell := ["bash", "-c"]

export NIGHTLY_TOOLCHAIN := "nightly-2022-04-04-x86_64-unknown-linux-gnu"

test:
cargo test

install-clippy:
rustup component add clippy

check PROJECT ARCH: install-clippy
cargo clippy --no-deps -p {{PROJECT}} --target {{ARCH}}

test PROJECT ARCH:
cargo test -p {{PROJECT}} --target {{ARCH}}

install-rustfmt:
rustup component add rustfmt

Expand Down Expand Up @@ -45,12 +45,18 @@ web-lib TARGET: nightly-toolchain (web-install "lib")
web-demo TARGET: (web-install "demo")
cd web/demo && npm run {{TARGET}}

web-test FEATURES: nightly-toolchain
export RUSTUP_TOOLCHAIN=$NIGHTLY_TOOLCHAIN && cargo test -p web --features "{{FEATURES}}" --target wasm32-unknown-unknown -Z build-std=std,panic_abort

#profile-bench:
# cargo flamegraph --bench render -- --bench

build-android: print-android-env
build-android: nightly-toolchain print-android-env
export RUSTUP_TOOLCHAIN=$NIGHTLY_TOOLCHAIN && cd android/gradle && ./gradlew assembleDebug

test-android TARGET: nightly-toolchain print-android-env
export RUSTUP_TOOLCHAIN=$NIGHTLY_TOOLCHAIN && cargo test -p maplibre-android --target {{TARGET}} -Z build-std=std,panic_abort

# language=bash
print-android-env:
#!/usr/bin/env bash
Expand Down
5 changes: 4 additions & 1 deletion maplibre-build-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ authors = ["Maximilian Ammann <max@maxammann.org>"]
license = "MIT OR Apache-2.0"
readme = "../README.md"

[features]
sqlite = ["rusqlite"]

[dependencies]
naga = { version = "0.8", features = ["wgsl-in"] }
walkdir = "2.3"
log = "0.4"
rusqlite = "0.26"
rusqlite = {version= "0.26", optional=true}
serde_json = "1.0"
flate2 = "1.0"
1 change: 1 addition & 0 deletions maplibre-build-tools/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#[cfg(feature = "sqlite")]
pub mod mbtiles;
pub mod wgsl;
2 changes: 1 addition & 1 deletion maplibre-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trace = ["maplibre/trace", "tracing-subscriber", "tracing-tracy", "tracy-client"

[dependencies]
env_logger = "0.9"
maplibre = { path = "../maplibre", version = "0.0.2" }
maplibre = { path = "../maplibre", version = "0.0.2", features = ["headless"] }
maplibre-winit = { path = "../maplibre-winit", version = "0.0.1" }

tracing = { version = "0.1" }
Expand Down
Loading

0 comments on commit 707c193

Please sign in to comment.