Skip to content

Commit 36a521d

Browse files
authored
Changes need for integration into liveview-client-swiftui (#81)
* Initial changes need for integration into liveview-client-swiftui * Remove x86 macos runner because it is flakey * Added uniffi-bindgen workspace project * Make phoenix-channels-client be feature flag dependent * Add livenchannels to ci for apple devices * Various fixes for watchos
1 parent 205796e commit 36a521d

File tree

32 files changed

+847
-533
lines changed

32 files changed

+847
-533
lines changed

.github/workflows/apple-devices.yml

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ jobs:
2424
- rust-target: "aarch64-apple-watchos-sim"
2525
os: macos-14
2626
apple-sim: "watchOS"
27-
- rust-target: "x86_64-apple-watchos-sim"
28-
os: macos-13
29-
apple-sim: "watchOS"
30-
- rust-target: "x86_64-apple-tvos"
31-
os: macos-13
32-
apple-sim: "tvOS"
33-
- rust-target: "x86_64-apple-ios"
34-
os: macos-13
35-
apple-sim: "iOS"
3627
steps:
3728
- uses: actions/checkout@v4
3829
- uses: dtolnay/rust-toolchain@master
@@ -54,37 +45,6 @@ jobs:
5445
cargo install --git https://github.com/sonos/dinghy.git --force --rev ${CARGO_DINGHY_REV} cargo-dinghy
5546
fi
5647
57-
- name: Cache deps
58-
id: cache-deps
59-
uses: actions/cache@v4
60-
env:
61-
cache-name: cache-elixir-deps
62-
with:
63-
path: tests/support/test_server/deps
64-
key: ${{ runner.os }}-${{ runner.arch }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
65-
restore-keys: |
66-
${{ runner.os }}-${{ runner.arch }}-mix-${{ env.cache-name }}-
67-
- name: Cache compiled build
68-
id: cache-build
69-
uses: actions/cache@v4
70-
env:
71-
cache-name: cache-compiled-build
72-
with:
73-
path: tests/support/test_server/_build
74-
key: ${{ runner.os }}-${{ runner.arch }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
75-
restore-keys: |
76-
${{ runner.os }}-${{ runner.arch }}-mix-${{ env.cache-name }}-
77-
${{ runner.os }}-${{ runner.arch }}-mix-
78-
- name: Set up Elixir
79-
run: brew install elixir
80-
81-
- name: Install test server dependencies, compile and run in background
82-
working-directory: ./tests/support/test_server
83-
run: |
84-
mix deps.get
85-
mix compile
86-
mix phx.server &
87-
8848
- name: Start Simulator
8949
uses: futureware-tech/simulator-action@v3
9050
with:
@@ -104,3 +64,23 @@ jobs:
10464
cargo dinghy all-platforms
10565
cargo dinghy all-devices
10666
cargo -Zbuild-std test --target ${{ matrix.rust-target }}
67+
68+
- name: Set up Elixir
69+
run: brew install elixir
70+
71+
- name: Install test server dependencies, compile and run in background
72+
working-directory: ./tests/support/test_server
73+
run: |
74+
mix deps.get
75+
mix compile
76+
mix phx.server &
77+
78+
- name: Run Rust tests on simulator for ${{ matrix.rust-target }}
79+
env:
80+
DINGHY_LOG: debug
81+
timeout-minutes: 20
82+
run: |
83+
cargo dinghy all-platforms
84+
cargo dinghy all-devices
85+
cargo -Zbuild-std test --target ${{ matrix.rust-target }} --features liveview-channels
86+
cargo -Zbuild-std test --target ${{ matrix.rust-target }} --features liveview-channels-tls

.github/workflows/macos.yml

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,36 @@ jobs:
2727
target
2828
key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.TOOLCHAIN }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2929

30-
- name: Cache deps
31-
id: cache-deps
32-
uses: actions/cache@v4
33-
env:
34-
cache-name: cache-elixir-deps
35-
with:
36-
path: tests/support/test_server/deps
37-
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
38-
restore-keys: |
39-
${{ runner.os }}-mix-${{ env.cache-name }}-
40-
- name: Cache compiled build
41-
id: cache-build
42-
uses: actions/cache@v4
43-
env:
44-
cache-name: cache-compiled-build
45-
with:
46-
path: tests/support/test_server/_build
47-
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
48-
restore-keys: |
49-
${{ runner.os }}-mix-${{ env.cache-name }}-
50-
${{ runner.os }}-mix-
51-
- name: Set up Elixir, kotlin and ktlint
52-
run: brew install elixir kotlin ktlint
53-
- name: Install test server dependencies, compile and run in background
54-
working-directory: ./tests/support/test_server
55-
run: |
56-
mix deps.get
57-
mix compile
58-
mix phx.server &
30+
# TODO: Fix this when enabling live-channels feature flag.
31+
# - name: Cache deps
32+
# id: cache-deps
33+
# uses: actions/cache@v4
34+
# env:
35+
# cache-name: cache-elixir-deps
36+
# with:
37+
# path: tests/support/test_server/deps
38+
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
39+
# restore-keys: |
40+
# ${{ runner.os }}-mix-${{ env.cache-name }}-
41+
# - name: Cache compiled build
42+
# id: cache-build
43+
# uses: actions/cache@v4
44+
# env:
45+
# cache-name: cache-compiled-build
46+
# with:
47+
# path: tests/support/test_server/_build
48+
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
49+
# restore-keys: |
50+
# ${{ runner.os }}-mix-${{ env.cache-name }}-
51+
# ${{ runner.os }}-mix-
52+
# - name: Set up Elixir, kotlin and ktlint
53+
# run: brew install elixir kotlin ktlint
54+
# - name: Install test server dependencies, compile and run in background
55+
# working-directory: ./tests/support/test_server
56+
# run: |
57+
# mix deps.get
58+
# mix compile
59+
# mix phx.server &
5960

6061
- name: Get the JNA jar for testing kotlin.
6162
run: wget 'https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar'

.github/workflows/uniffi-kotlin-tests.yml

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,37 @@ jobs:
3535
target
3636
key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.TOOLCHAIN }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3737

38-
- name: Cache deps
39-
id: cache-deps
40-
uses: actions/cache@v4
41-
env:
42-
cache-name: cache-elixir-deps
43-
with:
44-
path: tests/support/test_server/deps
45-
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
46-
restore-keys: |
47-
${{ runner.os }}-mix-${{ env.cache-name }}-
48-
- name: Cache compiled build
49-
id: cache-build
50-
uses: actions/cache@v4
51-
env:
52-
cache-name: cache-compiled-build
53-
with:
54-
path: tests/support/test_server/_build
55-
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
56-
restore-keys: |
57-
${{ runner.os }}-mix-${{ env.cache-name }}-
58-
${{ runner.os }}-mix-
59-
- name: Set up Elixir
60-
run: brew install elixir
61-
62-
- name: Install test server dependencies, compile and run in background
63-
working-directory: ./tests/support/test_server
64-
run: |
65-
mix deps.get
66-
mix compile
67-
mix phx.server &
38+
# TODO: Fix this when enabling live-channels feature flag.
39+
# - name: Cache deps
40+
# id: cache-deps
41+
# uses: actions/cache@v4
42+
# env:
43+
# cache-name: cache-elixir-deps
44+
# with:
45+
# path: tests/support/test_server/deps
46+
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
47+
# restore-keys: |
48+
# ${{ runner.os }}-mix-${{ env.cache-name }}-
49+
# - name: Cache compiled build
50+
# id: cache-build
51+
# uses: actions/cache@v4
52+
# env:
53+
# cache-name: cache-compiled-build
54+
# with:
55+
# path: tests/support/test_server/_build
56+
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
57+
# restore-keys: |
58+
# ${{ runner.os }}-mix-${{ env.cache-name }}-
59+
# ${{ runner.os }}-mix-
60+
# - name: Set up Elixir
61+
# run: brew install elixir
62+
#
63+
# - name: Install test server dependencies, compile and run in background
64+
# working-directory: ./tests/support/test_server
65+
# run: |
66+
# mix deps.get
67+
# mix compile
68+
# mix phx.server &
6869

6970
- name: Set up JDK 17
7071
uses: actions/setup-java@v4
@@ -73,7 +74,7 @@ jobs:
7374
distribution: 'temurin'
7475

7576
- name: Install gradle
76-
uses: gradle/gradle-build-action@v3.1.0
77+
uses: gradle/gradle-build-action@v3.2.1
7778

7879
# https://github.com/actions/runner-images/blob/5a9870800dc54127d22ee36c303b47314d231c69/images/macos/macos-14-arm64-Readme.md
7980
# There's no python in the m1 macos runners.

.github/workflows/uniffi-swift-test.yml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,37 @@ jobs:
2525
aarch64-apple-darwin
2626
x86_64-apple-darwin
2727

28-
- name: Cache deps
29-
id: cache-deps
30-
uses: actions/cache@v4
31-
env:
32-
cache-name: cache-elixir-deps
33-
with:
34-
path: tests/support/test_server/deps
35-
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
36-
restore-keys: |
37-
${{ runner.os }}-mix-${{ env.cache-name }}-
38-
- name: Cache compiled build
39-
id: cache-build
40-
uses: actions/cache@v4
41-
env:
42-
cache-name: cache-compiled-build
43-
with:
44-
path: tests/support/test_server/_build
45-
key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
46-
restore-keys: |
47-
${{ runner.os }}-mix-${{ env.cache-name }}-
48-
${{ runner.os }}-mix-
49-
- name: Set up Elixir
50-
run: brew install elixir
51-
52-
- name: Install test server dependencies, compile and run in background
53-
working-directory: ./tests/support/test_server
54-
run: |
55-
mix deps.get
56-
mix compile
57-
mix phx.server &
28+
# TODO: Fix this when enabling live-channels feature flag.
29+
# - name: Cache deps
30+
# id: cache-deps
31+
# uses: actions/cache@v4
32+
# env:
33+
# cache-name: cache-elixir-deps
34+
# with:
35+
# path: tests/support/test_server/deps
36+
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
37+
# restore-keys: |
38+
# ${{ runner.os }}-mix-${{ env.cache-name }}-
39+
# - name: Cache compiled build
40+
# id: cache-build
41+
# uses: actions/cache@v4
42+
# env:
43+
# cache-name: cache-compiled-build
44+
# with:
45+
# path: tests/support/test_server/_build
46+
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-2-${{ hashFiles('**/mix.lock') }}
47+
# restore-keys: |
48+
# ${{ runner.os }}-mix-${{ env.cache-name }}-
49+
# ${{ runner.os }}-mix-
50+
# - name: Set up Elixir
51+
# run: brew install elixir
52+
#
53+
# - name: Install test server dependencies, compile and run in background
54+
# working-directory: ./tests/support/test_server
55+
# run: |
56+
# mix deps.get
57+
# mix compile
58+
# mix phx.server &
5859

5960
- uses: taiki-e/install-action@v2
6061
with:

.github/workflows/x86_64-linux-android.yml

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,36 @@ jobs:
3939
cargo install --git https://github.com/sonos/dinghy.git --force --rev ${CARGO_DINGHY_REV} cargo-dinghy
4040
fi
4141
42-
- name: Cache deps
43-
id: cache-deps
44-
uses: actions/cache@v4
45-
env:
46-
cache-name: cache-elixir-deps
47-
with:
48-
path: tests/support/test_server/deps
49-
key: ${{ runner.os }}-mix-${{ env.cache-name }}-deps-${{ hashFiles('**/mix.lock') }}
50-
51-
- name: Cache compiled build
52-
id: cache-build
53-
uses: actions/cache@v4
54-
env:
55-
cache-name: cache-compiled-build
56-
with:
57-
path: tests/support/test_server/_build
58-
key: ${{ runner.os }}-mix-${{ env.cache-name }}-build-${{ hashFiles('**/mix.lock') }}
59-
60-
- uses: erlef/setup-beam@v1
61-
with:
62-
elixir-version: 1.15
63-
otp-version: 25
64-
65-
- name: Install test server dependencies, compile and run in background
66-
working-directory: ./tests/support/test_server
67-
run: |
68-
mix deps.get
69-
mix compile
70-
mix phx.server &
42+
# TODO: Fix this when enabling live-channels feature flag.
43+
# - name: Cache deps
44+
# id: cache-deps
45+
# uses: actions/cache@v4
46+
# env:
47+
# cache-name: cache-elixir-deps
48+
# with:
49+
# path: tests/support/test_server/deps
50+
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-deps-${{ hashFiles('**/mix.lock') }}
51+
#
52+
# - name: Cache compiled build
53+
# id: cache-build
54+
# uses: actions/cache@v4
55+
# env:
56+
# cache-name: cache-compiled-build
57+
# with:
58+
# path: tests/support/test_server/_build
59+
# key: ${{ runner.os }}-mix-${{ env.cache-name }}-build-${{ hashFiles('**/mix.lock') }}
60+
#
61+
# - uses: erlef/setup-beam@v1
62+
# with:
63+
# elixir-version: 1.15
64+
# otp-version: 25
65+
#
66+
# - name: Install test server dependencies, compile and run in background
67+
# working-directory: ./tests/support/test_server
68+
# run: |
69+
# mix deps.get
70+
# mix compile
71+
# mix phx.server &
7172

7273
- name: Set up JDK 17
7374
uses: actions/setup-java@v4

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"crates/core",
4+
"crates/core", "crates/uniffi-bindgen",
55
]
66

77
[workspace.package]
@@ -25,10 +25,15 @@ split-debuginfo = "unpacked"
2525
debug = 2
2626

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

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

0 commit comments

Comments
 (0)