mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
Compare commits
13 Commits
v0.30.12
...
notgull/ia
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3657449ab | ||
|
|
9382b7238c | ||
|
|
73348f49d7 | ||
|
|
49a315870e | ||
|
|
999a1f8733 | ||
|
|
023ab591b5 | ||
|
|
af32c5c298 | ||
|
|
0c4e725692 | ||
|
|
8671481db4 | ||
|
|
fe893e6690 | ||
|
|
5cfdb3fc42 | ||
|
|
e30f112516 | ||
|
|
f9a975e6e5 |
60
.github/workflows/ci.yml
vendored
60
.github/workflows/ci.yml
vendored
@@ -35,19 +35,20 @@ jobs:
|
||||
- { name: 'Linux 64bit', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, }
|
||||
- { name: 'X11', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: '--no-default-features --features=x11' }
|
||||
- { name: 'Wayland', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: '--no-default-features --features=wayland,wayland-dlopen' }
|
||||
- { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity', cmd: 'apk --' }
|
||||
- { name: 'Redox OS', target: x86_64-unknown-redox, os: ubuntu-latest, }
|
||||
- { name: 'macOS', target: x86_64-apple-darwin, os: macos-latest, }
|
||||
- { name: 'iOS x86_64', target: x86_64-apple-ios, os: macos-latest, }
|
||||
- { name: 'iOS Aarch64', target: aarch64-apple-ios, os: macos-latest, }
|
||||
- { name: 'web', target: wasm32-unknown-unknown, os: ubuntu-latest, }
|
||||
exclude:
|
||||
# Android is tested on stable-3
|
||||
- toolchain: '1.65.0'
|
||||
platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity', cmd: 'apk --' }
|
||||
include:
|
||||
# Android is tested on stable-3
|
||||
- toolchain: '1.69.0'
|
||||
platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity', cmd: 'apk --' }
|
||||
platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity' }
|
||||
- toolchain: 'stable'
|
||||
platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity' }
|
||||
- toolchain: 'nightly'
|
||||
platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity' }
|
||||
|
||||
|
||||
env:
|
||||
# Set more verbose terminal output
|
||||
@@ -59,7 +60,6 @@ jobs:
|
||||
RUSTDOCFLAGS: '--deny=warnings'
|
||||
|
||||
OPTIONS: --target=${{ matrix.platform.target }} ${{ matrix.platform.options }}
|
||||
CMD: ${{ matrix.platform.cmd }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -87,23 +87,11 @@ jobs:
|
||||
if: (matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')
|
||||
run: sudo apt-get update && sudo apt-get install gcc-multilib
|
||||
|
||||
- name: Cache cargo-apk
|
||||
if: contains(matrix.platform.target, 'android')
|
||||
id: cargo-apk-cache
|
||||
uses: actions/cache@v3
|
||||
- name: Install xbuild
|
||||
uses: taiki-e/install-action@v2
|
||||
if: contains(matrix.platform.target, 'android') || contains(matrix.platform.target, 'ios')
|
||||
with:
|
||||
path: ~/.cargo/bin/cargo-apk
|
||||
# Change this key if we update the required cargo-apk version
|
||||
key: cargo-apk-v0-9-7
|
||||
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
if: contains(matrix.platform.target, 'android') && (steps.cargo-apk-cache.outputs.cache-hit != 'true')
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install cargo-apk
|
||||
if: contains(matrix.platform.target, 'android') && (steps.cargo-apk-cache.outputs.cache-hit != 'true')
|
||||
run: cargo install cargo-apk --version=^0.9.7 --locked
|
||||
tool: xbuild@0.2.0
|
||||
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
@@ -111,17 +99,30 @@ jobs:
|
||||
targets: ${{ matrix.platform.target }}
|
||||
components: clippy
|
||||
|
||||
- name: Install LLVM tools for Android
|
||||
if: contains(matrix.platform.target, 'android')
|
||||
run: sudo apt-get update && sudo apt-get install lld llvm
|
||||
|
||||
- name: Check documentation
|
||||
run: cargo doc --no-deps $OPTIONS --document-private-items
|
||||
|
||||
- name: Build crate
|
||||
run: cargo $CMD build $OPTIONS
|
||||
- name: Build crate
|
||||
run: cargo build $OPTIONS
|
||||
|
||||
- name: Build and package crate for Android
|
||||
if: contains(matrix.platform.target, 'android')
|
||||
run: x build -p android-xbuild-target --platform android --arch arm64
|
||||
|
||||
- name: Build and package crate for iOS
|
||||
if: contains(matrix.platform.target, 'ios')
|
||||
run: x build -p ios-xbuild-target --platform ios --arch arm64
|
||||
|
||||
- name: Build tests
|
||||
if: >
|
||||
!contains(matrix.platform.target, 'redox') &&
|
||||
!contains(matrix.platform.target, 'android') &&
|
||||
matrix.toolchain != '1.65.0'
|
||||
run: cargo $CMD test --no-run $OPTIONS
|
||||
run: cargo test --no-run $OPTIONS
|
||||
|
||||
- name: Run tests
|
||||
if: >
|
||||
@@ -130,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')
|
||||
@@ -139,8 +140,9 @@ jobs:
|
||||
- name: Build tests with serde enabled
|
||||
if: >
|
||||
!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: >
|
||||
@@ -149,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,5 +212,7 @@ web-sys = { version = "0.3.22", features = ['CanvasRenderingContext2d'] }
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"xbuild/android-target",
|
||||
"xbuild/ios-target",
|
||||
"run-wasm",
|
||||
]
|
||||
|
||||
3
xbuild/README.md
Normal file
3
xbuild/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# xbuild-target
|
||||
|
||||
These are crates that can be built via `x build` in order to simplify CI testing.
|
||||
13
xbuild/android-target/Cargo.toml
Normal file
13
xbuild/android-target/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "android-xbuild-target"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
crate_type = ["cdylib"]
|
||||
|
||||
[dependencies.winit]
|
||||
version = "0.29.1-beta"
|
||||
path = "../.."
|
||||
features = ["android-native-activity"]
|
||||
11
xbuild/android-target/src/lib.rs
Normal file
11
xbuild/android-target/src/lib.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
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();
|
||||
}
|
||||
9
xbuild/ios-target/Cargo.toml
Normal file
9
xbuild/ios-target/Cargo.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "ios-xbuild-target"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[dependencies.winit]
|
||||
version = "0.29.1-beta"
|
||||
path = "../.."
|
||||
7
xbuild/ios-target/src/main.rs
Normal file
7
xbuild/ios-target/src/main.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
fn main() {
|
||||
winit::event_loop::EventLoopBuilder::new()
|
||||
.build()
|
||||
.unwrap()
|
||||
.run(|_, _| todo!())
|
||||
.ok();
|
||||
}
|
||||
Reference in New Issue
Block a user