diff --git a/.github/actions/android/action.yml b/.github/actions/android/action.yml index 94483c97..80dfa8fd 100644 --- a/.github/actions/android/action.yml +++ b/.github/actions/android/action.yml @@ -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 diff --git a/.github/actions/check/action.yml b/.github/actions/check/action.yml index 68ae9670..261aa637 100644 --- a/.github/actions/check/action.yml +++ b/.github/actions/check/action.yml @@ -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 \ No newline at end of file + run: just clippy \ No newline at end of file diff --git a/.github/actions/desktop/action.yml b/.github/actions/desktop/action.yml index 4217d2b5..bb0cb4ad 100644 --- a/.github/actions/desktop/action.yml +++ b/.github/actions/desktop/action.yml @@ -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 \ No newline at end of file + path: target/x86_64-unknown-linux-gnu/debug/maplibre-demo \ No newline at end of file diff --git a/.github/actions/docs/action.yml b/.github/actions/docs/action.yml index 0cbca8ea..9f636dc3 100644 --- a/.github/actions/docs/action.yml +++ b/.github/actions/docs/action.yml @@ -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: | @@ -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 diff --git a/.github/actions/webgl/action.yml b/.github/actions/webgl/action.yml index f1946ace..550d41f9 100644 --- a/.github/actions/webgl/action.yml +++ b/.github/actions/webgl/action.yml @@ -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 diff --git a/.github/actions/webgpu/action.yml b/.github/actions/webgpu/action.yml index d08ddf78..a79193a6 100644 --- a/.github/actions/webgpu/action.yml +++ b/.github/actions/webgpu/action.yml @@ -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 diff --git a/.github/workflows/apple.yml b/.github/workflows/apple.yml index 88b3d275..4cfa7d60 100644 --- a/.github/workflows/apple.yml +++ b/.github/workflows/apple.yml @@ -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 diff --git a/.github/workflows/on_main_push.yml b/.github/workflows/on_main_push.yml index 6bc8491c..21867592 100644 --- a/.github/workflows/on_main_push.yml +++ b/.github/workflows/on_main_push.yml @@ -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 @@ -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: diff --git a/.github/workflows/on_pull_request.yml b/.github/workflows/on_pull_request.yml index 0d4d99ae..6244219a 100644 --- a/.github/workflows/on_pull_request.yml +++ b/.github/workflows/on_pull_request.yml @@ -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 diff --git a/.gitignore b/.gitignore index 07585a30..a197b5b4 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.idea/maplibre-rs.iml b/.idea/maplibre-rs.iml index b84de464..761714ba 100644 --- a/.idea/maplibre-rs.iml +++ b/.idea/maplibre-rs.iml @@ -2,13 +2,20 @@ - - - - + + + + + + + + + + + diff --git a/.idea/runConfigurations/Render.xml b/.idea/runConfigurations/Build_All.xml similarity index 77% rename from .idea/runConfigurations/Render.xml rename to .idea/runConfigurations/Build_All.xml index c075c956..5a2421e3 100644 --- a/.idea/runConfigurations/Render.xml +++ b/.idea/runConfigurations/Build_All.xml @@ -1,6 +1,6 @@ - -