-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove split subdirectories as part of #372 modularization #374
Changes from all commits
1cb9aac
6344c06
2c8db67
460ad39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,7 @@ jobs: | |
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
# Use one of our supported targets to lint all crates including | ||
# the target-specific `ndk` in one go. | ||
# This assumes our host-tools (cargo-apk and dependencies) | ||
# also compile cleanly under this target. | ||
# Use a cross-compilation target (that's typical for Android) to lint everything | ||
args: --all --all-targets --all-features --target aarch64-linux-android -- -Dwarnings | ||
|
||
check_msrv: | ||
|
@@ -47,7 +44,7 @@ jobs: | |
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
# See comment above about using one of our supported targets. | ||
# Use a cross-compilation target (that's typical for Android) to lint everything | ||
args: --workspace --all-targets --all-features --target aarch64-linux-android | ||
|
||
build: | ||
|
@@ -57,123 +54,39 @@ jobs: | |
os: [ubuntu-latest] | ||
rust-channel: ['stable', 'nightly'] | ||
rust-target: | ||
- 'armv7-linux-androideabi' | ||
- 'aarch64-linux-android' | ||
- 'i686-linux-android' | ||
- 'x86_64-linux-android' | ||
- { triple: 'armv7-linux-androideabi', abi: armeabi-v7a } | ||
- { triple: 'aarch64-linux-android', abi: arm64-v8a } | ||
- { triple: 'i686-linux-android', abi: x86 } | ||
- { triple: 'x86_64-linux-android', abi: x86_64 } | ||
Comment on lines
+57
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw you created an issue about the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's a bit of a weird quirk with cargo ndk |
||
include: | ||
- os: windows-latest | ||
rust-channel: 'stable' | ||
rust-target: 'aarch64-linux-android' | ||
rust-target: { triple: 'aarch64-linux-android', abi: arm64-v8a } | ||
- os: windows-latest | ||
rust-channel: 'stable' | ||
rust-target: 'x86_64-linux-android' | ||
rust-target: { triple: 'x86_64-linux-android', abi: x86_64 } | ||
|
||
runs-on: ${{ matrix.os }} | ||
name: Build apk | ||
name: Cross-compile | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Installing Rust ${{ matrix.rust-channel }} w/ ${{ matrix.rust-target }} | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
|
||
- name: Install cargo-ndk | ||
run: cargo install cargo-ndk | ||
Comment on lines
+78
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /me pukes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was worried you were going to dislike it. It makes sense to me for now though, we just want to cross compile a library crate and that's not really what cargo apk is for. Hopefully this can just be seen as a minimal adaptation that's pragmatic for now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as it works... The CI is green, so it surprisingly does? |
||
|
||
- name: Installing Rust ${{ matrix.rust-channel }} w/ ${{ matrix.rust-target.triple }} | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust-channel }} | ||
target: ${{ matrix.rust-target }} | ||
target: ${{ matrix.rust-target.triple }} | ||
override: true | ||
|
||
- name: Install cargo-apk | ||
run: | ||
cargo install --path cargo-apk | ||
|
||
- name: Cargo check for target ${{ matrix.rust-target }} | ||
run: cargo check -p ndk --target ${{ matrix.rust-target }} --all-features | ||
|
||
- name: Cargo apk build for target ${{ matrix.rust-target }} | ||
run: cargo apk build -p ndk-examples --target ${{ matrix.rust-target }} --examples | ||
|
||
- uses: actions/upload-artifact@v2 | ||
# Only need this for CI, unless users are interested in downloading | ||
# a ready-made app that does nothing but printing "hello world". | ||
if: ${{ matrix.rust-target == 'x86_64-linux-android' }} | ||
name: Upload hello_world apk | ||
with: | ||
name: hello_world_${{ matrix.os }}_${{ matrix.rust-target }} | ||
path: ./target/debug/apk/examples/hello_world.apk | ||
|
||
android_emulator: | ||
name: hello_world example on emulator | ||
needs: build | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
source_os: [ubuntu-latest, windows-latest, local] | ||
env: | ||
api-level: 29 | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
arch: x86_64 | ||
# the `googleapis` emulator target is considerably slower on CI. | ||
target: default | ||
profile: Nexus 6 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/download-artifact@v2 | ||
name: Download hello_world APK | ||
if: ${{ matrix.source_os != 'local' }} | ||
id: download | ||
with: | ||
name: hello_world_${{ matrix.source_os }}_x86_64-linux-android | ||
|
||
- name: Install `cargo-apk` and add `x86_64-linux-android` target | ||
if: ${{ matrix.source_os == 'local' }} | ||
run: | | ||
cargo install --path cargo-apk | ||
rustup target add x86_64-linux-android | ||
|
||
- name: AVD cache | ||
uses: actions/cache@v2 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
# Bump the trailing number when making changes to the emulator setup below | ||
key: avd-${{ env.api-level }}-1 | ||
|
||
- name: create AVD and generate snapshot for caching | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ env.api-level }} | ||
arch: ${{ env.arch }} | ||
target: ${{ env.target }} | ||
profile: ${{ env.profile }} | ||
emulator-options: ${{ env.emulator-options }} | ||
disable-animations: true | ||
force-avd-creation: false | ||
script: echo "Generated AVD snapshot for caching." | ||
|
||
- name: Start hello_world example | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ env.api-level }} | ||
arch: ${{ env.arch }} | ||
target: ${{ env.target }} | ||
profile: ${{ env.profile }} | ||
emulator-options: -no-snapshot-save ${{ env.emulator-options }} | ||
disable-animations: true | ||
force-avd-creation: false | ||
script: ./.github/workflows/android_test.sh "${{ steps.download.outputs.download-path }}" | ||
|
||
- name: Upload emulator logs | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ always() }} | ||
with: | ||
name: log | ||
path: ~/logcat.log | ||
- name: Compile for ${{ matrix.rust-target.triple }} | ||
run: cargo ndk -t ${{ matrix.rust-target.abi }} build | ||
|
||
build-host: | ||
strategy: | ||
|
@@ -202,22 +115,6 @@ jobs: | |
run: | ||
cargo test -p ndk --all-features | ||
|
||
- name: Test ndk-build | ||
run: | ||
cargo test -p ndk-build --all-features | ||
|
||
- name: Test ndk-glue | ||
run: | ||
cargo test -p ndk-glue --all-features | ||
|
||
- name: Test ndk-macro | ||
run: | ||
cargo test -p ndk-macro --all-features | ||
|
||
- name: Test cargo-apk | ||
run: | ||
cargo test -p cargo-apk --all-features | ||
|
||
docs: | ||
strategy: | ||
fail-fast: false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
[workspace] | ||
members = [ | ||
"ndk", | ||
"ndk-context", | ||
"ndk-macro", | ||
"ndk-build", | ||
"ndk-examples", | ||
"ndk-glue", | ||
"ndk-sys", | ||
"cargo-apk", | ||
] |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clean this up in the inverse way in the
cargo-apk
repository, since it specifically does not have to run on the target arch anymore, but on a (set of) host(s)?OTOH that host might as well be an Android phone; linting for all the triples is fine by me but the comment is dated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it'd make sense in
cargo-apk
to lint with host targets, since it's a tool that runs on the host. It should be easy to follow up on iterating / cleaning up the CI in any of the standalone repos.My first changes were just focused on making minimal CI updates that could ensure everything was building with green lights in the standalone repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly the comment that's off now, I'm fine having "android" itself as a host if someone wants to build APKs from Android for Android (Termux anyone?).