Skip to content

Commit

Permalink
Move Test CI and release ci into one yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
simlay committed Apr 25, 2024
1 parent c2d864d commit 5728964
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 90 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Integration Tests

on: pull_request
on:
- workflow_dispatch
- push
- pull_request

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -296,6 +299,8 @@ jobs:

- name: Run tests in android emulator
uses: reactivecircus/android-emulator-runner@v2
env:
RANLIB: "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib"
with:
api-level: ${{ env.ANDROID_API }}
ndk: ${{ env.ANDROID_NDK_VERSION }}
Expand All @@ -307,4 +312,45 @@ jobs:
script: |
cargo dinghy all-platforms
cargo dinghy all-devices
RANLIB=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib cargo dinghy -p auto-android-x86_64-api${ANDROID_API} test -- --test-threads 1
cargo dinghy -p auto-android-x86_64-api${ANDROID_API} test -- --test-threads 1
build-xcframework:
runs-on: macos-14

steps:
- uses: actions/checkout@v4
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.TOOLCHAIN }}
components: rust-src
targets:
aarch64-apple-ios-sim
aarch64-apple-ios
x86_64-apple-ios
aarch64-apple-darwin
x86_64-apple-darwin

- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/git
~/.cargo/registry
target
key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.TOOLCHAIN }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: taiki-e/install-action@v2
with:
tool: cargo-make
- name: Build XCFramework
run: |
cargo make --profile release uniffi-xcframework
ditto -c -k --sequesterRsrc --keepParent target/uniffi/swift/liveview_native_core.xcframework/ target/uniffi/swift/liveview_native_core.xcframework.zip
- uses: actions/upload-artifact@v4
with:
retention-days: 5
name: liveview_native_core.xcframework
path: ./target/uniffi/swift/liveview_native_core.xcframework.zip
88 changes: 0 additions & 88 deletions .github/workflows/release.yml

This file was deleted.

27 changes: 27 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ args = [
"--target", "aarch64-apple-ios",
"--target", "aarch64-apple-ios-sim",
"--target", "x86_64-apple-ios",

#"--target", "aarch64-apple-visionos",
#"--target", "aarch64-apple-visionos-sim",
"-p", "liveview-native-core"
]
dependencies = ["install-targets"]
Expand Down Expand Up @@ -374,6 +377,14 @@ args = [
# tvOS sim
"-library", "${CARGO_TARGET_DIR}/universal/tvos-sim/libliveview_native_core.a",
"-headers", "${CARGO_TARGET_DIR}/uniffi/swift/generated",

# visionOS
#"-library", "${CARGO_TARGET_DIR}/aarch64-apple-visionos/${CARGO_BUILD_TYPE}/libliveview_native_core.a",
#"-headers", "${CARGO_TARGET_DIR}/uniffi/swift/generated",

# visionOS sim
#"-library", "${CARGO_TARGET_DIR}/aarch64-apple-visionos-sim/${CARGO_BUILD_TYPE}/libliveview_native_core.a",
#"-headers", "${CARGO_TARGET_DIR}/uniffi/swift/generated",
]
dependencies = [
"build-apple-std-targets",
Expand Down Expand Up @@ -461,6 +472,22 @@ args = [
]
dependencies = ["uniffi-swift-package", "uniffi-xcframework"]

[tasks.uniffi-swift-test-visionos]
workspace = false
category = "Packaging"
description = "Generates the LiveViewNativeCore.xcframework package"
command = "xcodebuild"
args = [
"-scheme",
"LiveViewNativeCore",
"-destination",
"name=Apple Vision Pro",
"-workspace",
"${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/crates/core/liveview-native-core-swift/",
"test"
]
dependencies = ["uniffi-swift-package", "uniffi-xcframework"]

[tasks.uniffi-swift-test-macos]
workspace = false
category = "Packaging"
Expand Down

0 comments on commit 5728964

Please sign in to comment.