Fix clippy in CI

This commit is contained in:
Maximilian Ammann 2022-04-24 12:08:53 +02:00
parent e7e14d014d
commit 66ffdfdd02
13 changed files with 67 additions and 27 deletions

View File

@ -12,7 +12,13 @@ runs:
- name: Build
shell: bash
run: just build-android
- name: Check x86_64
shell: bash
run: just check maplibre-android x86_64-linux-android
- name: Check aarch64
shell: bash
run: just check maplibre-android aarch64-linux-android
- uses: actions/upload-artifact@v2
with:
name: maplibre-rs.apk
path: target/debug/apk/maplibre-rs-demo.apk
path: target/debug/apk/maplibre-rs-linux-demo.apk

View File

@ -1,5 +1,5 @@
name: desktop
description: Build for desktop
name: macOS
description: Build for macOS
runs:
using: "composite"
@ -9,9 +9,16 @@ runs:
shell: bash
run: just default-toolchain
- uses: Swatinem/rust-cache@v1
- name: Build xcframework
- name: Build
shell: bash
run: just xcodebuild-xcframework
- name: Check x86_64 darwin
shell: bash
run: just check apple x86_64-apple-darwin
- name: Check aarch64 darwin
shell: bash
run: just check apple aarch64-apple-darwin
# TODO: Additional clippy checks for iOS
- name: Build Example
shell: bash
run: cd apple/xcode && xcodebuild -scheme "example (iOS)" -arch arm64 -sdk iphoneos build CODE_SIGNING_ALLOWED=NO

17
.github/actions/benchmarks/action.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: benchmarks
description: Run benchmarks
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: Check
shell: bash
run: just check maplibre-benchmarks x86_64-unknown-linux-gnu

View File

@ -12,9 +12,3 @@ runs:
- name: Format
shell: bash
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: just clippy

View File

@ -1,5 +1,5 @@
name: desktop
description: Build for desktop
name: linux-demo
description: Build linux-demo for linux
runs:
using: "composite"
@ -15,6 +15,9 @@ runs:
- name: Build
shell: bash
run: cargo build -p maplibre-demo
- name: Check
shell: bash
run: just check maplibre-demo x86_64-unknown-linux-gnu
- uses: actions/upload-artifact@v2
with:
name: maplibre-rs

View File

@ -12,3 +12,6 @@ runs:
- name: Build
shell: bash
run: just webpack-webgl-production
- name: Check
shell: bash
run: just check web wasm32-unknown-unknown

View File

@ -12,3 +12,6 @@ runs:
- name: Build
shell: bash
run: just webpack-production
- name: Check
shell: bash
run: just check web wasm32-unknown-unknown

View File

@ -12,11 +12,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/check
build-desktop:
run-benchmarks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/desktop
- uses: ./.github/actions/benchmarks
build-linux-demo:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/linux-demo
build-android:
runs-on: ubuntu-20.04
steps:
@ -29,7 +34,7 @@ jobs:
- uses: ./.github/actions/webgpu
- uses: ./.github/actions/deploy
with:
source: web/web/dist/demo/.
source: web/web/dist/linux-demo/.
destination: webgpu
key: ${{ secrets.SSH_KEY_MAXAMMANN_ORG }}
build-deploy-webgl:
@ -39,7 +44,7 @@ jobs:
- uses: ./.github/actions/webgl
- uses: ./.github/actions/deploy
with:
source: web/web/dist/demo/.
source: web/web/dist/linux-demo/.
destination: webgl
key: ${{ secrets.SSH_KEY_MAXAMMANN_ORG }}
build-deploy-docs:

View File

@ -12,11 +12,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/check
build-desktop:
run-benchmarks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/desktop
- uses: ./.github/actions/benchmarks
build-linux-demo:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/linux-demo
build-android:
runs-on: ubuntu-20.04
steps:

View File

@ -9,11 +9,9 @@ publish = false
[dependencies]
maplibre = { path = "../maplibre" }
env_logger = "0.9"
[target.'cfg(target_os = "android")'.dependencies]
log = "0.4.16"
ndk-glue = "0.5.0" # version is required by winit
jni = "0.19.0"
log = "0.4.16"
[lib]
#name = "maplibre_android" Currently not supported: https://github.com/rust-windowing/android-ndk-rs/issues/136

View File

@ -2,9 +2,8 @@ use maplibre::window::FromWindow;
use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod};
pub use std::time::Instant;
// TODO clippy
// #[cfg(not(any(target_os = "macos", target_os = "ios")))]
// compile_error!("apple works only on macOS and iOS.");
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
compile_error!("apple works only on macOS and iOS.");
#[no_mangle]
pub fn maplibre_apple_main() {

View File

@ -1,5 +1,5 @@
[package]
name = "maplibre-benchmark"
name = "benchmarks"
version = "0.1.0"
description = ""
categories = []

View File

@ -12,8 +12,8 @@ test:
install-clippy:
rustup component add clippy
clippy: install-clippy
cargo clippy --all-targets --all-features --no-deps
check PROJECT ARCH: install-clippy
cargo clippy --no-deps -p {{PROJECT}} --target {{ARCH}}
install-rustfmt:
rustup component add rustfmt