Skip to content

Changes need for integration into liveview-client-swiftui #81

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

Merged
merged 23 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 20 additions & 40 deletions .github/workflows/apple-devices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ jobs:
- rust-target: "aarch64-apple-watchos-sim"
os: macos-14
apple-sim: "watchOS"
- rust-target: "x86_64-apple-watchos-sim"
os: macos-13
apple-sim: "watchOS"
- rust-target: "x86_64-apple-tvos"
os: macos-13
apple-sim: "tvOS"
- rust-target: "x86_64-apple-ios"
os: macos-13
apple-sim: "iOS"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand All @@ -54,37 +45,6 @@ jobs:
cargo install --git https://github.com/sonos/dinghy.git --force --rev ${CARGO_DINGHY_REV} cargo-dinghy
fi

- name: Cache deps
id: cache-deps
uses: actions/cache@v4
env:
cache-name: cache-elixir-deps
with:
path: tests/support/test_server/deps
key: ${{ runner.os }}-${{ runner.arch }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-mix-${{ env.cache-name }}-
- name: Cache compiled build
id: cache-build
uses: actions/cache@v4
env:
cache-name: cache-compiled-build
with:
path: tests/support/test_server/_build
key: ${{ runner.os }}-${{ runner.arch }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-mix-${{ env.cache-name }}-
${{ runner.os }}-${{ runner.arch }}-mix-
- name: Set up Elixir
run: brew install elixir

- name: Install test server dependencies, compile and run in background
working-directory: ./tests/support/test_server
run: |
mix deps.get
mix compile
mix phx.server &

- name: Start Simulator
uses: futureware-tech/simulator-action@v3
with:
Expand All @@ -104,3 +64,23 @@ jobs:
cargo dinghy all-platforms
cargo dinghy all-devices
cargo -Zbuild-std test --target ${{ matrix.rust-target }}

- name: Set up Elixir
run: brew install elixir

- name: Install test server dependencies, compile and run in background
working-directory: ./tests/support/test_server
run: |
mix deps.get
mix compile
mix phx.server &

- name: Run Rust tests on simulator for ${{ matrix.rust-target }}
env:
DINGHY_LOG: debug
timeout-minutes: 20
run: |
cargo dinghy all-platforms
cargo dinghy all-devices
cargo -Zbuild-std test --target ${{ matrix.rust-target }} --features liveview-channels
cargo -Zbuild-std test --target ${{ matrix.rust-target }} --features liveview-channels-tls
59 changes: 30 additions & 29 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,36 @@ jobs:
target
key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.TOOLCHAIN }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Cache deps
id: cache-deps
uses: actions/cache@v4
env:
cache-name: cache-elixir-deps
with:
path: tests/support/test_server/deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
- name: Cache compiled build
id: cache-build
uses: actions/cache@v4
env:
cache-name: cache-compiled-build
with:
path: tests/support/test_server/_build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- name: Set up Elixir, kotlin and ktlint
run: brew install elixir kotlin ktlint
- name: Install test server dependencies, compile and run in background
working-directory: ./tests/support/test_server
run: |
mix deps.get
mix compile
mix phx.server &
# TODO: Fix this when enabling live-channels feature flag.
# - name: Cache deps
# id: cache-deps
# uses: actions/cache@v4
# env:
# cache-name: cache-elixir-deps
# with:
# path: tests/support/test_server/deps
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
# restore-keys: |
# ${{ runner.os }}-mix-${{ env.cache-name }}-
# - name: Cache compiled build
# id: cache-build
# uses: actions/cache@v4
# env:
# cache-name: cache-compiled-build
# with:
# path: tests/support/test_server/_build
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
# restore-keys: |
# ${{ runner.os }}-mix-${{ env.cache-name }}-
# ${{ runner.os }}-mix-
# - name: Set up Elixir, kotlin and ktlint
# run: brew install elixir kotlin ktlint
# - name: Install test server dependencies, compile and run in background
# working-directory: ./tests/support/test_server
# run: |
# mix deps.get
# mix compile
# mix phx.server &

- name: Get the JNA jar for testing kotlin.
run: wget 'https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar'
Expand Down
63 changes: 32 additions & 31 deletions .github/workflows/uniffi-kotlin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,37 @@ jobs:
target
key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.TOOLCHAIN }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Cache deps
id: cache-deps
uses: actions/cache@v4
env:
cache-name: cache-elixir-deps
with:
path: tests/support/test_server/deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
- name: Cache compiled build
id: cache-build
uses: actions/cache@v4
env:
cache-name: cache-compiled-build
with:
path: tests/support/test_server/_build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- name: Set up Elixir
run: brew install elixir

- name: Install test server dependencies, compile and run in background
working-directory: ./tests/support/test_server
run: |
mix deps.get
mix compile
mix phx.server &
# TODO: Fix this when enabling live-channels feature flag.
# - name: Cache deps
# id: cache-deps
# uses: actions/cache@v4
# env:
# cache-name: cache-elixir-deps
# with:
# path: tests/support/test_server/deps
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
# restore-keys: |
# ${{ runner.os }}-mix-${{ env.cache-name }}-
# - name: Cache compiled build
# id: cache-build
# uses: actions/cache@v4
# env:
# cache-name: cache-compiled-build
# with:
# path: tests/support/test_server/_build
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
# restore-keys: |
# ${{ runner.os }}-mix-${{ env.cache-name }}-
# ${{ runner.os }}-mix-
# - name: Set up Elixir
# run: brew install elixir
#
# - name: Install test server dependencies, compile and run in background
# working-directory: ./tests/support/test_server
# run: |
# mix deps.get
# mix compile
# mix phx.server &

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -73,7 +74,7 @@ jobs:
distribution: 'temurin'

- name: Install gradle
uses: gradle/gradle-build-action@v3.1.0
uses: gradle/gradle-build-action@v3.2.1

# https://github.com/actions/runner-images/blob/5a9870800dc54127d22ee36c303b47314d231c69/images/macos/macos-14-arm64-Readme.md
# There's no python in the m1 macos runners.
Expand Down
61 changes: 31 additions & 30 deletions .github/workflows/uniffi-swift-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,37 @@ jobs:
aarch64-apple-darwin
x86_64-apple-darwin

- name: Cache deps
id: cache-deps
uses: actions/cache@v4
env:
cache-name: cache-elixir-deps
with:
path: tests/support/test_server/deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
- name: Cache compiled build
id: cache-build
uses: actions/cache@v4
env:
cache-name: cache-compiled-build
with:
path: tests/support/test_server/_build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- name: Set up Elixir
run: brew install elixir

- name: Install test server dependencies, compile and run in background
working-directory: ./tests/support/test_server
run: |
mix deps.get
mix compile
mix phx.server &
# TODO: Fix this when enabling live-channels feature flag.
# - name: Cache deps
# id: cache-deps
# uses: actions/cache@v4
# env:
# cache-name: cache-elixir-deps
# with:
# path: tests/support/test_server/deps
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
# restore-keys: |
# ${{ runner.os }}-mix-${{ env.cache-name }}-
# - name: Cache compiled build
# id: cache-build
# uses: actions/cache@v4
# env:
# cache-name: cache-compiled-build
# with:
# path: tests/support/test_server/_build
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
# restore-keys: |
# ${{ runner.os }}-mix-${{ env.cache-name }}-
# ${{ runner.os }}-mix-
# - name: Set up Elixir
# run: brew install elixir
#
# - name: Install test server dependencies, compile and run in background
# working-directory: ./tests/support/test_server
# run: |
# mix deps.get
# mix compile
# mix phx.server &

- uses: taiki-e/install-action@v2
with:
Expand Down
59 changes: 30 additions & 29 deletions .github/workflows/x86_64-linux-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,36 @@ jobs:
cargo install --git https://github.com/sonos/dinghy.git --force --rev ${CARGO_DINGHY_REV} cargo-dinghy
fi

- name: Cache deps
id: cache-deps
uses: actions/cache@v4
env:
cache-name: cache-elixir-deps
with:
path: tests/support/test_server/deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-deps-${{ hashFiles('**/mix.lock') }}

- name: Cache compiled build
id: cache-build
uses: actions/cache@v4
env:
cache-name: cache-compiled-build
with:
path: tests/support/test_server/_build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-build-${{ hashFiles('**/mix.lock') }}

- uses: erlef/setup-beam@v1
with:
elixir-version: 1.15
otp-version: 25

- name: Install test server dependencies, compile and run in background
working-directory: ./tests/support/test_server
run: |
mix deps.get
mix compile
mix phx.server &
# TODO: Fix this when enabling live-channels feature flag.
# - name: Cache deps
# id: cache-deps
# uses: actions/cache@v4
# env:
# cache-name: cache-elixir-deps
# with:
# path: tests/support/test_server/deps
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-deps-${{ hashFiles('**/mix.lock') }}
#
# - name: Cache compiled build
# id: cache-build
# uses: actions/cache@v4
# env:
# cache-name: cache-compiled-build
# with:
# path: tests/support/test_server/_build
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-build-${{ hashFiles('**/mix.lock') }}
#
# - uses: erlef/setup-beam@v1
# with:
# elixir-version: 1.15
# otp-version: 25
#
# - name: Install test server dependencies, compile and run in background
# working-directory: ./tests/support/test_server
# run: |
# mix deps.get
# mix compile
# mix phx.server &

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand Down
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"
members = [
"crates/core",
"crates/core", "crates/uniffi-bindgen",
]

[workspace.package]
Expand All @@ -25,10 +25,15 @@ split-debuginfo = "unpacked"
debug = 2

[profile.release]
opt-level = 1
opt-level = 'z' # Optimize for size
lto = true # Enable link-time optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
panic = 'abort' # Abort on panic
strip = 'debuginfo' # Strip symbols from binary*
split-debuginfo = "packed"
debug = 1


[patch.crates-io]
# Work for https://github.com/sfackler/rust-native-tls/pull/285 hasn't been published to crates.io yet.
native-tls = { git = "https://github.com/sfackler/rust-native-tls", rev = "0b69ce6a3c4bfe973ede44f6862fc13f3f09c773" }
Expand Down
Loading