Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor crates #12

Merged
merged 25 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions .github/actions/android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ description: Build for android
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates*
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install just
- uses: extractions/setup-just@v1
- name: Install nightly toolchain
shell: bash
run: cargo install just
run: just nightly-toolchain
- uses: Swatinem/rust-cache@v1
with:
toolchain: nightly
- name: Build
shell: bash
run: just build-apk
Expand Down
13 changes: 6 additions & 7 deletions .github/actions/check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ description: Check
runs:
using: "composite"
steps:
- name: Setup
- uses: extractions/setup-just@v1
- name: Install toolchain
shell: bash
run: |
rustup component add rustfmt
run: just default-toolchain
- uses: Swatinem/rust-cache@v1
- 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
19 changes: 7 additions & 12 deletions .github/actions/desktop/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,18 @@ description: Build for desktop
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates*
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- 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: Build
shell: bash
run: cargo build --example desktop
run: cargo build -p maplibre-demo
- uses: actions/upload-artifact@v2
with:
name: maplibre-rs
path: target/debug/maplibre
path: target/x86_64-unknown-linux-gnu/debug/maplibre-demo
17 changes: 6 additions & 11 deletions .github/actions/docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@ description: Build documentation
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates*
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-1
- uses: extractions/setup-just@v1
- name: Install toolchain
shell: bash
run: just default-toolchain
- uses: Swatinem/rust-cache@v1
- name: Install mdbook
shell: bash
run: |
Expand All @@ -27,4 +22,4 @@ runs:
run: mdbook build
- name: API Documentation
shell: bash
run: cargo doc --no-deps --workspace --lib --all-features --document-private-items
run: cargo doc -p maplibre --no-deps --lib --all-features --document-private-items
18 changes: 6 additions & 12 deletions .github/actions/webgl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ description: Build for webgl
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates*
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install just
- uses: extractions/setup-just@v1
- name: Install nightly toolchain
shell: bash
run: cargo install just
run: just nightly-toolchain
- uses: Swatinem/rust-cache@v1
with:
toolchain: nightly
- name: Build
shell: bash
run: just webpack-webgl-production
18 changes: 6 additions & 12 deletions .github/actions/webgpu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ description: Build for webgpu
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates*
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install just
- uses: extractions/setup-just@v1
- name: Install nightly toolchain
shell: bash
run: cargo install just
run: just nightly-toolchain
- uses: Swatinem/rust-cache@v1
with:
toolchain: nightly
- name: Build
shell: bash
run: just webpack-production
52 changes: 9 additions & 43 deletions .github/workflows/apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,17 @@ on:
- cron: '0 17 * * 1'

jobs:
build-macos:
runs-on: macOS-11
build:
runs-on: macOS-12
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cargo Build
run: cargo build --target aarch64-apple-darwin --lib
- name: XCode Build
run: cd apple/mapr && xcodebuild -scheme "mapr (macOS)" -arch arm64 build

build-iphoneos:
runs-on: macOS-11
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cargo Build
run: cargo build --target aarch64-apple-ios --lib # First running `cargo build` before `xcodebuild` is REQUIRED!
# Else the rust compilation fails during linking. This is
# probably due to some weird environment variables set during
# xcodebuild execution
- name: XCode Build
run: cd apple/mapr && xcodebuild -scheme "mapr (iOS)" -arch arm64 -sdk iphoneos build CODE_SIGNING_ALLOWED=NO
- uses: extractions/setup-just@v1
- uses: actions-rs/toolchain@v1
- uses: Swatinem/rust-cache@v1
- name: Build xcframework
run: just xcodebuild-xcframework
- name: Build Example
run: cd apple/xcode && xcodebuild -scheme "example (iOS)" -arch arm64 -sdk iphoneos build CODE_SIGNING_ALLOWED=NO
6 changes: 5 additions & 1 deletion .github/workflows/on_main_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/android
build-deploy-web:
build-deploy-webgpu:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -32,6 +32,10 @@ jobs:
source: web/dist/demo/.
destination: webgpu
key: ${{ secrets.SSH_KEY_MAXAMMANN_ORG }}
build-deploy-webgl:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/webgl
- uses: ./.github/actions/deploy
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/android
build-web:
build-webgpu:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/webgpu
build-webgl:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/webgl
build-docs:
runs-on: ubuntu-20.04
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
# FIXME: remove lock file after it reached stability
# Cargo.lock
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk
Expand Down
15 changes: 11 additions & 4 deletions .idea/maplibre-rs.iml

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

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

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Build_Android.xml

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

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Build_WASM.xml

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

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

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

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

18 changes: 0 additions & 18 deletions .idea/runConfigurations/Run_desktop__release_enable_tracing_.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Run_web__webgl__.xml

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

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Run_web__webgpu_.xml

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

Loading