Skip to content

Commit 07ddbf2

Browse files
committed
Add job to test building Ferric Apple triplets
1 parent 10654d4 commit 07ddbf2

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/check.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,50 @@ jobs:
188188
with:
189189
name: emulator-logcat
190190
path: apps/test-app/emulator-logcat.txt
191+
test-ferric-apple-triplets:
192+
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Ferric 🦀')
193+
name: Test ferric Apple triplets
194+
runs-on: macos-latest
195+
steps:
196+
- uses: actions/checkout@v4
197+
- uses: actions/setup-node@v4
198+
with:
199+
node-version: lts/jod
200+
- name: Set up JDK 17
201+
uses: actions/setup-java@v3
202+
with:
203+
java-version: "17"
204+
distribution: "temurin"
205+
- run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim
206+
- run: rustup toolchain install nightly --component rust-src
207+
- run: npm ci
208+
- run: npm run build
209+
# Build weak-node-api for all Apple architectures
210+
- run: npm run build-weak-node-api -- --apple
211+
working-directory: packages/host
212+
# Build Ferric example for all Apple architectures
213+
- run: npx ferric --apple
214+
working-directory: packages/ferric-example
215+
- name: Inspect the structure of the prebuilt binary
216+
run: lipo -info ferric_example.apple.node/*/libferric_example.framework/libferric_example > lipo-info.txt
217+
working-directory: packages/ferric-example
218+
- name: Upload lipo info
219+
uses: actions/upload-artifact@v4
220+
with:
221+
name: lipo-info
222+
path: packages/ferric-example/lipo-info.txt
223+
- name: Verify Apple triplet builds
224+
run: |
225+
# Create expected fixture content
226+
cat > expected-lipo-info.txt << 'EOF'
227+
Architectures in the fat file: ferric_example.apple.node/ios-arm64_x86_64-simulator/libferric_example.framework/libferric_example are: x86_64 arm64
228+
Architectures in the fat file: ferric_example.apple.node/macos-arm64_x86_64/libferric_example.framework/libferric_example are: x86_64 arm64
229+
Architectures in the fat file: ferric_example.apple.node/tvos-arm64_x86_64-simulator/libferric_example.framework/libferric_example are: x86_64 arm64
230+
Non-fat file: ferric_example.apple.node/ios-arm64/libferric_example.framework/libferric_example is architecture: arm64
231+
Non-fat file: ferric_example.apple.node/tvos-arm64/libferric_example.framework/libferric_example is architecture: arm64
232+
Non-fat file: ferric_example.apple.node/xros-arm64-simulator/libferric_example.framework/libferric_example is architecture: arm64
233+
Non-fat file: ferric_example.apple.node/xros-arm64/libferric_example.framework/libferric_example is architecture: arm64
234+
EOF
235+
# Compare with expected fixture (will fail if files differ)
236+
diff expected-lipo-info.txt lipo-info.txt
237+
working-directory: packages/ferric-example

0 commit comments

Comments
 (0)