Skip to content
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
15 changes: 15 additions & 0 deletions .github/workflows/on-pr-dory-smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,27 @@ jobs:
echo "DEVELOPER_DIR=$newest/Contents/Developer" >> "$GITHUB_ENV"
sudo xcode-select -s "$newest/Contents/Developer"

# Dory's rebased upstream builds its Swift package against a generated
# Rust UniFFI XCFramework. A clean checkout has no binary artifact, so
# raw xcodebuild cannot resolve DoryFFI until this preparation runs.
- name: Install Rust toolchain for Dory FFI
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable

- name: Install Dory FFI build prerequisites
run: brew install protobuf

- name: Build Dory from source
working-directory: dory-src
run: |
set -euxo pipefail
# Match dory CI: Metal toolchain download can be flaky; best-effort.
xcodebuild -downloadComponent MetalToolchain || true
# Match dory's scripts/build.sh + scripts/test.sh clean-checkout
# contract: materialize the ignored DoryFFI binary and generated
# Swift bindings before SwiftPM resolves the app dependencies.
scripts/build-dory-ffi-xcframework.sh --if-needed
test -f dory-core-swift/artifacts/DoryFFI.xcframework/macos-arm64_x86_64/libdory_ffi.a
test -f dory-core-swift/Sources/DoryCore/generated/dory_ffi.swift
# Prefer deterministic product path via -derivedDataPath (not scripts/build.sh
# alone, which may use a user-local DerivedData path).
xcodebuild -project Dory.xcodeproj -scheme Dory \
Expand Down
19 changes: 19 additions & 0 deletions tests/dory_smoke_workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ fn dory_smoke_workflow_clone_build_install_contract() {
text.contains("xcodebuild") && text.contains("derivedDataPath"),
"must build in-pipeline with deterministic derivedDataPath"
);
assert!(
text.contains("dtolnay/rust-toolchain") && text.contains("brew install protobuf"),
"must install the Rust and protoc prerequisites used by Dory's FFI builder"
);
let ffi_build = text
.find("scripts/build-dory-ffi-xcframework.sh --if-needed")
.expect("must materialize DoryFFI from a clean checkout");
let app_build = text
.find("xcodebuild -project Dory.xcodeproj")
.expect("must build the Dory app");
assert!(
ffi_build < app_build,
"must generate DoryFFI before SwiftPM resolves the Dory app"
);
assert!(
text.contains("DoryFFI.xcframework/macos-arm64_x86_64/libdory_ffi.a")
&& text.contains("Sources/DoryCore/generated/dory_ffi.swift"),
"must verify both generated Dory FFI artifacts before xcodebuild"
);
assert!(
text.contains("GITHUB_PATH") && text.contains("scripts"),
"must put scripts/dory on PATH"
Expand Down
Loading