This commit is contained in:
Maximilian Ammann 2022-04-20 21:18:01 +02:00
parent 3a7c9d1c03
commit 0ada6c6ed3
3 changed files with 49 additions and 44 deletions

View File

@ -4,18 +4,15 @@ description: Check
runs:
using: "composite"
steps:
- name: Setup
- name: Install just
shell: bash
run: |
rustup component add rustfmt
run: cargo install just
- name: Format
shell: bash
run: cargo fmt --all -- --check
run: just fmt-check
- name: Install Dependencies
shell: bash
run: sudo apt-get install -y libwayland-dev libxkbcommon-dev # Required for winit
- name: Clippy
shell: bash
run: |
rustup component add clippy
cargo clippy --all-targets --all-features
run: just clippy

View File

@ -19,8 +19,8 @@ runs:
run: sudo apt-get install -y libwayland-dev libxkbcommon-dev # Required for winit
- name: Build
shell: bash
run: cargo build --example desktop
run: cargo build -p maplibre-example
- uses: actions/upload-artifact@v2
with:
name: maplibre-rs
path: target/debug/maplibre
path: target/x86_64-unknown-linux-gnu/debug/maplibre-example

View File

@ -7,55 +7,68 @@ export RUSTUP_TOOLCHAIN := "nightly-2022-04-04-x86_64-unknown-linux-gnu"
test:
cargo test
clippy:
install-clippy:
rustup component add clippy
clippy: install-clippy
cargo clippy --all-targets --all-features
fmt:
install-rustfmt:
rustup component add rustfmt
fmt: install-rustfmt
cargo fmt --all --
fmt-check: install-rustfmt
cargo fmt --all -- --check
nightly-toolchain:
rustup install $RUSTUP_TOOLCHAIN
rustup component add rust-src --toolchain $RUSTUP_TOOLCHAIN
webpack-webgl-production: nightly-toolchain
cd web && npm install && npm run webgl-production-build
cd maplibre-web/web && npm install && npm run webgl-production-build
webpack-production: nightly-toolchain
cd web && npm install && npm run production-build
cd maplibre-web/web && npm install && npm run production-build
wasm-pack-webgl: nightly-toolchain
./wasm-pack-v0.10.1-x86_64-unknown-linux-musl/wasm-pack build . \
--release --target web --out-dir web/dist/maplibre-rs -- \
--features "web-webgl" -Z build-std=std,panic_abort
wasm-pack: nightly-toolchain
./wasm-pack-v0.10.1-x86_64-unknown-linux-musl/wasm-pack build . \
--release --target web --out-dir web/dist/maplibre-rs -- \
-Z build-std=std,panic_abort
build-web-webgl: nightly-toolchain
cargo build --features web-webgl --target wasm32-unknown-unknown -Z build-std=std,panic_abort
build-web: nightly-toolchain
cargo build --features "" --target wasm32-unknown-unknown -Z build-std=std,panic_abort
wasm-bindgen:
cargo install wasm-bindgen-cli
# TODO: Untested: --reference-types
wasm-bindgen --target web --out-dir web/dist/maplibre-rs-plain-bindgen target/wasm32-unknown-unknown/debug/maplibre.wasm
build-wasm-bindgen: build-web wasm-bindgen
build-wasm-bindgen-webgpu: build-web wasm-bindgen
# TODO
# wasm-pack-webgl: nightly-toolchain
# ./wasm-pack-v0.10.1-x86_64-unknown-linux-musl/wasm-pack build . \
# --release --target web --out-dir web/dist/maplibre-rs -- \
# --features "web-webgl" -Z build-std=std,panic_abort
#
# wasm-pack: nightly-toolchain
# ./wasm-pack-v0.10.1-x86_64-unknown-linux-musl/wasm-pack build . \
# --release --target web --out-dir web/dist/maplibre-rs -- \
# -Z build-std=std,panic_abort
#
# build-web-webgl: nightly-toolchain
# cargo build --features web-webgl --target wasm32-unknown-unknown -Z build-std=std,panic_abort
#
# build-web: nightly-toolchain
# cargo build --features "" --target wasm32-unknown-unknown -Z build-std=std,panic_abort
#
# wasm-bindgen:
# cargo install wasm-bindgen-cli
# # TODO: Untested: --reference-types
# wasm-bindgen --target web --out-dir web/dist/maplibre-rs-plain-bindgen target/wasm32-unknown-unknown/debug/maplibre.wasm
#
# build-wasm-bindgen: build-web wasm-bindgen
#
# build-wasm-bindgen-webgpu: build-web wasm-bindgen
# TODO
#profile-bench:
# cargo flamegraph --bench render -- --bench
install-cargo-apk:
cargo install cargo-apk
run-apk: nightly-toolchain install-cargo-apk
cargo apk run --lib -Zbuild-std
cargo apk run -p maplibre-android --lib -Zbuild-std
build-apk: nightly-toolchain install-cargo-apk
cargo apk build --lib -Zbuild-std
cargo apk build -p maplibre-android --lib -Zbuild-std
# language=bash
print-android-env:
@ -63,11 +76,6 @@ print-android-env:
echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT"
echo "ANDROID_NDK_ROOT: $ANDROID_NDK_ROOT"
# FIXME
profile-bench:
cargo flamegraph --bench render -- --bench
# language=bash
extract-tiles:
#!/usr/bin/env bash