mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@@ -60,7 +60,6 @@ jobs:
|
||||
RUSTDOCFLAGS: '--deny=warnings'
|
||||
|
||||
OPTIONS: --target=${{ matrix.platform.target }} ${{ matrix.platform.options }}
|
||||
CMD: ${{ matrix.platform.cmd }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -102,7 +101,7 @@ jobs:
|
||||
|
||||
- name: Install LLVM tools for Android
|
||||
if: contains(matrix.platform.target, 'android')
|
||||
run: sudo apt-get install lld llvm
|
||||
run: sudo apt-get update && sudo apt-get install lld llvm
|
||||
|
||||
- name: Check documentation
|
||||
run: cargo doc --no-deps $OPTIONS --document-private-items
|
||||
@@ -110,13 +109,13 @@ jobs:
|
||||
- name: Build crate
|
||||
run: cargo build $OPTIONS
|
||||
|
||||
- name: Package crate for Android
|
||||
- name: Build and package crate for Android
|
||||
if: contains(matrix.platform.target, 'android')
|
||||
run: x build -p xbuild-target --platform android --arch arm64
|
||||
run: x build -p android-xbuild-target --platform android --arch arm64
|
||||
|
||||
- name: Package crate for iOS
|
||||
- name: Build and package crate for iOS
|
||||
if: contains(matrix.platform.target, 'ios')
|
||||
run: x build -p xbuild-target --platform ios --arch arm64
|
||||
run: x build -p ios-xbuild-target --platform ios --arch arm64
|
||||
|
||||
- name: Build tests
|
||||
if: >
|
||||
@@ -132,7 +131,7 @@ jobs:
|
||||
!contains(matrix.platform.target, 'wasm32') &&
|
||||
!contains(matrix.platform.target, 'redox') &&
|
||||
matrix.toolchain != '1.65.0'
|
||||
run: cargo $CMD test $OPTIONS
|
||||
run: cargo test $OPTIONS
|
||||
|
||||
- name: Lint with clippy
|
||||
if: (matrix.toolchain == 'stable') && !contains(matrix.platform.options, '--no-default-features')
|
||||
@@ -143,7 +142,7 @@ jobs:
|
||||
!contains(matrix.platform.target, 'redox') &&
|
||||
!contains(matrix.platform.target, 'android') &&
|
||||
matrix.toolchain != '1.65.0'
|
||||
run: cargo $CMD test --no-run $OPTIONS --features serde
|
||||
run: cargo test --no-run $OPTIONS --features serde
|
||||
|
||||
- name: Run tests with serde enabled
|
||||
if: >
|
||||
@@ -152,7 +151,7 @@ jobs:
|
||||
!contains(matrix.platform.target, 'wasm32') &&
|
||||
!contains(matrix.platform.target, 'redox') &&
|
||||
matrix.toolchain != '1.65.0'
|
||||
run: cargo $CMD test $OPTIONS --features serde
|
||||
run: cargo test $OPTIONS --features serde
|
||||
|
||||
# See restore step above
|
||||
- name: Save cache of cargo folder
|
||||
|
||||
@@ -212,6 +212,7 @@ web-sys = { version = "0.3.22", features = ['CanvasRenderingContext2d'] }
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"android-xbuild-target",
|
||||
"ios-xbuild-target",
|
||||
"run-wasm",
|
||||
"xbuild-target"
|
||||
]
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
[package]
|
||||
name = "xbuild-target"
|
||||
name = "android-xbuild-target"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
crate_type = ["cdylib"]
|
||||
|
||||
[dependencies.winit]
|
||||
version = "0.29.1-beta"
|
||||
path = ".."
|
||||
features = ["android-game-activity"]
|
||||
|
||||
3
android-xbuild-target/README.md
Normal file
3
android-xbuild-target/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# android-xbuild-target
|
||||
|
||||
This is a crate that can be built via `x build` in order to simplify CI testing.
|
||||
14
android-xbuild-target/src/lib.rs
Normal file
14
android-xbuild-target/src/lib.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use winit::platform::android::{
|
||||
activity::AndroidApp,
|
||||
EventLoopBuilderExtAndroid
|
||||
};
|
||||
|
||||
#[no_mangle]
|
||||
fn android_main(app: AndroidApp) {
|
||||
winit::event_loop::EventLoopBuilder::new()
|
||||
.with_android_app(app)
|
||||
.build()
|
||||
.unwrap()
|
||||
.run(|_, _| todo!())
|
||||
.ok();
|
||||
}
|
||||
8
ios-xbuild-target/Cargo.toml
Normal file
8
ios-xbuild-target/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "ios-xbuild-target"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies.winit]
|
||||
version = "0.29.1-beta"
|
||||
path = ".."
|
||||
@@ -1,4 +1,3 @@
|
||||
# xbuild-target
|
||||
# ios-xbuild-target
|
||||
|
||||
This is a crate that can be built via `x build` in order to simplify CI testing.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
fn main() {
|
||||
winit::event_loop::EventLoop::new()
|
||||
winit::event_loop::EventLoopBuilder::new()
|
||||
.build()
|
||||
.unwrap()
|
||||
.run(|_, _| todo!())
|
||||
.ok();
|
||||
Reference in New Issue
Block a user