-
Notifications
You must be signed in to change notification settings - Fork 1
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
CI: Run tests on all platforms and verify build #10
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The library is not Mac/iThing specific. UniFFI supports other languages that work on all platforms. Furthermore, Swift actually supports Linux and we might want the SDK to support that platform one day. It therefore seems reasonable to avoid unknowingly adding anything that breaks Linux support in this library. Hence we should also test the Rust code on Windows and Ubuntu.
bisgardo
force-pushed
the
ci/multiplatform
branch
from
March 17, 2024 11:30
04064e4
to
dbce236
Compare
We use `ProcessInfo`, which is part of `Foundation`, to read env vars in the package spec. The package looks to be automatically imported in newer versions of Swift/macOS, but to support older ones we need to do it explicitly.
Rename generated framework to `ConcordiumWalletCryptoUniffi.xcframework` to match the (similarly renamed) binary target in `Package.swift`. We cannot just rename the target to match the existing generated file because that name (`ConcordiumWalletCrypto`) is already used by the library product target. This is a requirement that apparently has been lifted in newer versions of Swift/macOS, but to support older versions, we follow it.
Also updated changelog.
bisgardo
force-pushed
the
ci/multiplatform
branch
from
March 17, 2024 17:10
d90a668
to
ba0eb6b
Compare
For the purpose of verifying that the library builds on CI, there's no point in building the binary framework for all platforms, just for the build platform itself. We take into account that some ("older") runners are Intel macs while others ("newer") run on Apple Silicon.
bisgardo
force-pushed
the
ci/multiplatform
branch
from
March 17, 2024 20:21
c0d4823
to
4551df4
Compare
bisgardo
changed the title
CI: Run tests on all platforms
CI: Run tests on all platforms and verify build
Mar 17, 2024
bisgardo
force-pushed
the
ci/multiplatform
branch
from
March 17, 2024 21:33
58048cb
to
56eb0e5
Compare
eb-concordium
approved these changes
Mar 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This library is not Mac/iThing specific. UniFFI supports other languages that work on all platforms. Furthermore, Swift actually supports Linux and we might want the SDK to support that platform one day.
It therefore seems reasonable to avoid unknowingly adding anything that breaks multiplatform support in this library. Hence we should also test the Rust code on Ubuntu and Windows.
We also run on all available macOS runners, including building the actual Swift package, to gain assurance that older versions work as well. With this, we found that a few changes were required for supporting older versions of Swift (back to the version running on the oldest Mac-based GitHub Actions runner
macos-11
, which is an Intel Mac):Foundation
inPackage.swift
for usingProcessInfo
(for reading env vars).swift-tools-version
to v5.5 inPackage.swift
.ConcordiumWalletCryptoUniffi.xcframework
to match the (similarly renamed) binary target inPackage.swift
. We cannot just rename the target to match the existing generated file because that name (ConcordiumWalletCrypto
) is already used by the library product target.To avoid wasting resources and also speed up verification of the Swift package itself, we only build the framework for the runner platform, not the full multi-platform bundle produced by
make framework
.