Compare commits

...

13 Commits

Author SHA1 Message Date
John Nunley
d3657449ab Review comments
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
9382b7238c Eyepatch for the android linker error
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
73348f49d7 fmt
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
49a315870e Review comments
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
999a1f8733 Hacky way to exclude 1.65.0 on Android
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
023ab591b5 Disable test builds on Android
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
af32c5c298 Don't use CMD subselection on Android
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
0c4e725692 Fix compile error in xbuild-target
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
8671481db4 Once more unto the breach!
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
fe893e6690 Empty commit to re-run CI
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
5cfdb3fc42 Typo!
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
e30f112516 Fix malformed install-action call
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
John Nunley
f9a975e6e5 Use xbuild instead of cargo apk in the CI
In addition to cargo apk being deprecated, xbuild also has support for
ios.

Signed-off-by: John Nunley <dev@notgull.net>
2023-10-14 21:37:15 -07:00
7 changed files with 76 additions and 29 deletions

View File

@@ -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

View File

@@ -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
View File

@@ -0,0 +1,3 @@
# xbuild-target
These are crates that can be built via `x build` in order to simplify CI testing.

View 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"]

View 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();
}

View 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 = "../.."

View File

@@ -0,0 +1,7 @@
fn main() {
winit::event_loop::EventLoopBuilder::new()
.build()
.unwrap()
.run(|_, _| todo!())
.ok();
}